    001package net.minecraft.network.packet;
    002
    003import java.io.DataInputStream;
    004import java.io.DataOutputStream;
    005import java.io.IOException;
    006
    007public class Packet4UpdateTime extends Packet
    008{
    009    /** World age in ticks. */
    010    public long worldAge;
    011
    012    /** The world time in minutes. */
    013    public long time;
    014
    015    public Packet4UpdateTime() {}
    016
    017    public Packet4UpdateTime(long par1, long par3)
    018    {
    019        this.worldAge = par1;
    020        this.time = par3;
    021    }
    022
    023    /**
    024     * Abstract. Reads the raw packet data from the data stream.
    025     */
    026    public void readPacketData(DataInputStream par1DataInputStream) throws IOException
    027    {
    028        this.worldAge = par1DataInputStream.readLong();
    029        this.time = par1DataInputStream.readLong();
    030    }
    031
    032    /**
    033     * Abstract. Writes the raw packet data to the data stream.
    034     */
    035    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
    036    {
    037        par1DataOutputStream.writeLong(this.worldAge);
    038        par1DataOutputStream.writeLong(this.time);
    039    }
    040
    041    /**
    042     * Passes this Packet on to the NetHandler for processing.
    043     */
    044    public void processPacket(NetHandler par1NetHandler)
    045    {
    046        par1NetHandler.handleUpdateTime(this);
    047    }
    048
    049    /**
    050     * Abstract. Return the size of the packet (not counting the header).
    051     */
    052    public int getPacketSize()
    053    {
    054        return 16;
    055    }
    056
    057    /**
    058     * only false for the abstract Packet class, all real packets return true
    059     */
    060    public boolean isRealPacket()
    061    {
    062        return true;
    063    }
    064
    065    /**
    066     * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet
    067     * class
    068     */
    069    public boolean containsSameEntityIDAs(Packet par1Packet)
    070    {
    071        return true;
    072    }
    073
    074    /**
    075     * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to
    076     * handle.
    077     */
    078    public boolean canProcessAsync()
    079    {
    080        return true;
    081    }
    082}