diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
commit | 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch) | |
tree | cb302d8e0f46e06be0b1d391317578b165aec245 /main/java/gregtech/api/net/GT_Packet_Block_Event.java | |
parent | ce25063b910bb3bdd2b0c234b185fc4077caebdb (diff) | |
download | GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2 GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip |
Move source directory
Diffstat (limited to 'main/java/gregtech/api/net/GT_Packet_Block_Event.java')
-rw-r--r-- | main/java/gregtech/api/net/GT_Packet_Block_Event.java | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/main/java/gregtech/api/net/GT_Packet_Block_Event.java b/main/java/gregtech/api/net/GT_Packet_Block_Event.java deleted file mode 100644 index 95932d581c..0000000000 --- a/main/java/gregtech/api/net/GT_Packet_Block_Event.java +++ /dev/null @@ -1,59 +0,0 @@ -package gregtech.api.net; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; - -import com.google.common.io.ByteArrayDataInput; -import com.google.common.io.ByteArrayDataOutput; -import com.google.common.io.ByteStreams; - -/** - * Used to transfer Block Events in a much better fashion - */ -public class GT_Packet_Block_Event extends GT_Packet { - private int mX, mZ; - private short mY; - private byte mID, mValue; - - public GT_Packet_Block_Event() { - super(true); - } - - public GT_Packet_Block_Event(int aX, short aY, int aZ, byte aID, byte aValue) { - super(false); - mX = aX; - mY = aY; - mZ = aZ; - mID = aID; - mValue = aValue; - } - - @Override - public byte[] encode() { - ByteArrayDataOutput tOut = ByteStreams.newDataOutput(10); - tOut.writeInt(mX); - tOut.writeShort(mY); - tOut.writeInt(mZ); - tOut.writeByte(mID); - tOut.writeByte(mValue); - return tOut.toByteArray(); - } - - @Override - public GT_Packet decode(ByteArrayDataInput aData) { - return new GT_Packet_Block_Event(aData.readInt(), aData.readShort(), aData.readInt(), aData.readByte(), aData.readByte()); - } - - @Override - public void process(IBlockAccess aWorld) { - if (aWorld != null) { - TileEntity tTileEntity = aWorld.getTileEntity(mX, mY, mZ); - if (tTileEntity != null) tTileEntity.receiveClientEvent(mID, mValue); - } - } - - @Override - public byte getPacketID() { - return 2; - } -}
\ No newline at end of file |