diff options
author | Blood-Asp <bloodasphendrik@gmail.com> | 2017-06-14 23:51:39 +0200 |
---|---|---|
committer | Blood-Asp <bloodasphendrik@gmail.com> | 2017-06-14 23:51:39 +0200 |
commit | 911a80752930d6207fc0b850f3ccf8b3da05b0a5 (patch) | |
tree | 76ba0e8245b9e871ea730c6ce7355b55cf88f81a /src/main/java/gregtech/api | |
parent | 6b4b32200dce4e3ca2e2813a106a50cb14be38a8 (diff) | |
download | GT5-Unofficial-911a80752930d6207fc0b850f3ccf8b3da05b0a5.tar.gz GT5-Unofficial-911a80752930d6207fc0b850f3ccf8b3da05b0a5.tar.bz2 GT5-Unofficial-911a80752930d6207fc0b850f3ccf8b3da05b0a5.zip |
pollution smog
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/net/GT_Packet_Pollution.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/net/GT_Packet_Pollution.java b/src/main/java/gregtech/api/net/GT_Packet_Pollution.java new file mode 100644 index 0000000000..e403cae4e9 --- /dev/null +++ b/src/main/java/gregtech/api/net/GT_Packet_Pollution.java @@ -0,0 +1,43 @@ +package gregtech.api.net; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; +import com.google.common.io.ByteStreams; + +import gregtech.common.GT_Pollution; +import net.minecraft.world.IBlockAccess; + +public class GT_Packet_Pollution extends GT_Packet { + private int mPollution; + + public GT_Packet_Pollution() { + super(true); + } + + public GT_Packet_Pollution(int aPollution) { + super(false); + mPollution = aPollution; + } + + @Override + public byte[] encode() { + ByteArrayDataOutput tOut = ByteStreams.newDataOutput(4); + tOut.writeInt(mPollution); + return tOut.toByteArray(); + } + + @Override + public GT_Packet decode(ByteArrayDataInput aData) { + return new GT_Packet_Pollution(aData.readInt()); + } + + @Override + public void process(IBlockAccess aWorld) { + GT_Pollution.mPlayerPollution = mPollution; + } + + @Override + public byte getPacketID() { + return 4; + } +}
\ No newline at end of file |