diff options
Diffstat (limited to 'src/main/java/gregtech/api/net/GT_Packet.java')
-rw-r--r-- | src/main/java/gregtech/api/net/GT_Packet.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/net/GT_Packet.java b/src/main/java/gregtech/api/net/GT_Packet.java index e2b7b247b2..4bf435ca0c 100644 --- a/src/main/java/gregtech/api/net/GT_Packet.java +++ b/src/main/java/gregtech/api/net/GT_Packet.java @@ -1,8 +1,13 @@ package gregtech.api.net; import com.google.common.io.ByteArrayDataInput; +import io.netty.buffer.ByteBuf; import net.minecraft.world.IBlockAccess; +/** + * @deprecated Use {@link GT_Packet_New} instead + */ +@Deprecated public abstract class GT_Packet { public GT_Packet(boolean aIsReference) { // @@ -17,13 +22,28 @@ public abstract class GT_Packet { /** * @return encoded byte Stream + * @deprecated Use {@link #encode(ByteBuf)} instead */ + @Deprecated public abstract byte[] encode(); /** + * Encode the data into given byte buffer without creating an intermediate byte array. + * Default implementation just throw {@link UnsupportedOperationException}. + */ + public void encode(ByteBuf aOut) { + throw new UnsupportedOperationException(); + } + + /** * @return encoded byte Stream */ public abstract GT_Packet decode(ByteArrayDataInput aData); + /** + * Process the packet + * + * @param aWorld null if message is received on server side, the client world if message is received on client side + */ public abstract void process(IBlockAccess aWorld); } |