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