diff options
Diffstat (limited to 'src/main/java/gregtech/api/net/GT_Packet_TileEntity.java')
-rw-r--r-- | src/main/java/gregtech/api/net/GT_Packet_TileEntity.java | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java b/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java index 457bd7f21d..051be672ab 100644 --- a/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java +++ b/src/main/java/gregtech/api/net/GT_Packet_TileEntity.java @@ -1,14 +1,13 @@ package gregtech.api.net; import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; +import io.netty.buffer.ByteBuf; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; -public class GT_Packet_TileEntity extends GT_Packet { +public class GT_Packet_TileEntity extends GT_Packet_New { private int mX, mZ, mC0, mC1, mC2, mC3, mC4, mC5; private short mY, mID; private byte mTexture, mTexturePage, mUpdate, mRedstone, mColor; @@ -58,32 +57,28 @@ public class GT_Packet_TileEntity extends GT_Packet { } @Override - public byte[] encode() { - ByteArrayDataOutput tOut = ByteStreams.newDataOutput(41); + public void encode(ByteBuf aOut) { + aOut.writeInt(mX); + aOut.writeShort(mY); + aOut.writeInt(mZ); + aOut.writeShort(mID); - tOut.writeInt(mX); - tOut.writeShort(mY); - tOut.writeInt(mZ); - tOut.writeShort(mID); + aOut.writeInt(mC0); + aOut.writeInt(mC1); + aOut.writeInt(mC2); + aOut.writeInt(mC3); + aOut.writeInt(mC4); + aOut.writeInt(mC5); - tOut.writeInt(mC0); - tOut.writeInt(mC1); - tOut.writeInt(mC2); - tOut.writeInt(mC3); - tOut.writeInt(mC4); - tOut.writeInt(mC5); - - tOut.writeByte(mTexture); - tOut.writeByte(mTexturePage); - tOut.writeByte(mUpdate); - tOut.writeByte(mRedstone); - tOut.writeByte(mColor); - - return tOut.toByteArray(); + aOut.writeByte(mTexture); + aOut.writeByte(mTexturePage); + aOut.writeByte(mUpdate); + aOut.writeByte(mRedstone); + aOut.writeByte(mColor); } @Override - public GT_Packet decode(ByteArrayDataInput aData) { + public GT_Packet_New decode(ByteArrayDataInput aData) { return new GT_Packet_TileEntity(aData.readInt(), aData.readShort(), aData.readInt(), aData.readShort(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt(), aData.readByte(), aData.readByte(), aData.readByte(), aData.readByte(), aData.readByte()); } @@ -104,4 +99,4 @@ public class GT_Packet_TileEntity extends GT_Packet { public byte getPacketID() { return 0; } -}
\ No newline at end of file +} |