diff options
author | Johannes Gäßler <updrn@student.kit.edu> | 2017-06-18 17:26:04 +0200 |
---|---|---|
committer | Johannes Gäßler <updrn@student.kit.edu> | 2017-06-18 17:26:04 +0200 |
commit | 668ca431a8039f920414f296e00194a164ce5f4e (patch) | |
tree | c808e407ae3f0c950bd201e735ce5bb99c34abe3 /src/main/java/gregtech/api/net | |
parent | a739167c7f28c65b6f66960150791eb9d1181e29 (diff) | |
parent | 337b6fc66d25361095ad4eddd86992d92668be03 (diff) | |
download | GT5-Unofficial-668ca431a8039f920414f296e00194a164ce5f4e.tar.gz GT5-Unofficial-668ca431a8039f920414f296e00194a164ce5f4e.tar.bz2 GT5-Unofficial-668ca431a8039f920414f296e00194a164ce5f4e.zip |
Merge remote-tracking branch 'origin/unstable' into OilRefining
Conflicts:
src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java
src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java
Diffstat (limited to 'src/main/java/gregtech/api/net')
-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 |