|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.minecraft.network.packet.Packet
public abstract class Packet
Field Summary | |
---|---|
long |
creationTimeMillis
the system time in milliseconds when this packet was created. |
boolean |
isChunkDataPacket
Only true for Packet51MapChunk, Packet52MultiBlockChange, Packet53BlockChange and Packet59ComplexEntity. |
static IntHashMap |
packetIdToClassMap
Maps packet id to packet class |
static long |
receivedID
|
static long |
receivedSize
|
static long |
sentID
Assumed to be sequential by the profiler. |
static long |
sentSize
|
Constructor Summary | |
---|---|
Packet()
|
Method Summary | |
---|---|
static void |
addIdClassMapping(int par0,
boolean par1,
boolean par2,
Class par3Class)
Adds a two way mapping between the packet ID and packet class. |
boolean |
canProcessAsync()
If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to handle. |
boolean |
containsSameEntityIDAs(Packet par1Packet)
eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet class |
static Packet |
getNewPacket(int par0)
Returns a new instance of the specified Packet class. |
int |
getPacketId()
Returns the ID of this packet. |
abstract int |
getPacketSize()
Abstract. |
boolean |
isRealPacket()
only false for the abstract Packet class, all real packets return true |
abstract void |
processPacket(NetHandler var1)
Passes this Packet on to the NetHandler for processing. |
static byte[] |
readBytesFromStream(DataInputStream par0DataInputStream)
the first short in the stream indicates the number of bytes to read |
static ItemStack |
readItemStack(DataInputStream par0DataInputStream)
Reads a ItemStack from the InputStream |
static NBTTagCompound |
readNBTTagCompound(DataInputStream par0DataInputStream)
Reads a compressed NBTTagCompound from the InputStream |
static Packet |
readPacket(DataInputStream par0DataInputStream,
boolean par1,
Socket par2Socket)
Read a packet, prefixed by its ID, from the data stream. |
abstract void |
readPacketData(DataInputStream var1)
Abstract. |
static String |
readString(DataInputStream par0DataInputStream,
int par1)
Reads a string from a packet |
String |
toString()
|
static void |
writeByteArray(DataOutputStream par0DataOutputStream,
byte[] par1ArrayOfByte)
Writes a byte array to the DataOutputStream |
static void |
writeItemStack(ItemStack par0ItemStack,
DataOutputStream par1DataOutputStream)
Writes the ItemStack's ID (short), then size (byte), then damage. |
static void |
writePacket(Packet par0Packet,
DataOutputStream par1DataOutputStream)
Writes a packet, prefixed by its ID, to the data stream. |
abstract void |
writePacketData(DataOutputStream var1)
Abstract. |
static void |
writeString(String par0Str,
DataOutputStream par1DataOutputStream)
Writes a String to the DataOutputStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static IntHashMap packetIdToClassMap
public final long creationTimeMillis
public static long receivedID
public static long receivedSize
public static long sentID
public static long sentSize
public boolean isChunkDataPacket
Constructor Detail |
---|
public Packet()
Method Detail |
---|
public static void addIdClassMapping(int par0, boolean par1, boolean par2, Class par3Class)
public static Packet getNewPacket(int par0)
public static void writeByteArray(DataOutputStream par0DataOutputStream, byte[] par1ArrayOfByte) throws IOException
IOException
public static byte[] readBytesFromStream(DataInputStream par0DataInputStream) throws IOException
IOException
public final int getPacketId()
public static Packet readPacket(DataInputStream par0DataInputStream, boolean par1, Socket par2Socket) throws IOException
IOException
public static void writePacket(Packet par0Packet, DataOutputStream par1DataOutputStream) throws IOException
IOException
public static void writeString(String par0Str, DataOutputStream par1DataOutputStream) throws IOException
IOException
public static String readString(DataInputStream par0DataInputStream, int par1) throws IOException
IOException
public abstract void readPacketData(DataInputStream var1) throws IOException
IOException
public abstract void writePacketData(DataOutputStream var1) throws IOException
IOException
public abstract void processPacket(NetHandler var1)
public abstract int getPacketSize()
public boolean isRealPacket()
public boolean containsSameEntityIDAs(Packet par1Packet)
public boolean canProcessAsync()
public String toString()
toString
in class Object
public static ItemStack readItemStack(DataInputStream par0DataInputStream) throws IOException
IOException
public static void writeItemStack(ItemStack par0ItemStack, DataOutputStream par1DataOutputStream) throws IOException
IOException
public static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |