diff options
author | miozune <miozune@gmail.com> | 2023-05-08 17:25:22 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 10:25:22 +0200 |
commit | 4f5d9697557f8aeee32fe2b1cc5e22393a7ff8ad (patch) | |
tree | 28a350d6afca99a0ed5befe62769cb63352a4734 /src/main/java/gregtech/common/net | |
parent | 312812a4b8ee14ab2f1ad53ed2a941543942f16e (diff) | |
download | GT5-Unofficial-4f5d9697557f8aeee32fe2b1cc5e22393a7ff8ad.tar.gz GT5-Unofficial-4f5d9697557f8aeee32fe2b1cc5e22393a7ff8ad.tar.bz2 GT5-Unofficial-4f5d9697557f8aeee32fe2b1cc5e22393a7ff8ad.zip |
Migrate to FluidSlotWidget from FluidDisplaySlotWidget (#1963)
Diffstat (limited to 'src/main/java/gregtech/common/net')
-rw-r--r-- | src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java b/src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java deleted file mode 100644 index 2887714996..0000000000 --- a/src/main/java/gregtech/common/net/MessageUpdateFluidDisplayItem.java +++ /dev/null @@ -1,63 +0,0 @@ -package gregtech.common.net; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.DimensionManager; - -import com.google.common.io.ByteArrayDataInput; - -import gregtech.api.interfaces.IHasFluidDisplayItem; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.net.GT_Packet_New; -import io.netty.buffer.ByteBuf; - -public class MessageUpdateFluidDisplayItem extends GT_Packet_New { - - private int mBlockX, mBlockY, mBlockZ, mDim; - - public MessageUpdateFluidDisplayItem() { - super(true); - } - - public MessageUpdateFluidDisplayItem(int mBlockX, int mBlockY, int mBlockZ, int mDim) { - super(false); - this.mBlockX = mBlockX; - this.mBlockY = mBlockY; - this.mBlockZ = mBlockZ; - this.mDim = mDim; - } - - @Override - public byte getPacketID() { - return 8; - } - - @Override - public void encode(ByteBuf aOut) { - aOut.writeInt(mBlockX); - aOut.writeInt(mBlockY); - aOut.writeInt(mBlockZ); - aOut.writeInt(mDim); - } - - @Override - public GT_Packet_New decode(ByteArrayDataInput aData) { - return new MessageUpdateFluidDisplayItem(aData.readInt(), aData.readInt(), aData.readInt(), aData.readInt()); - } - - @Override - public void process(IBlockAccess aWorld) { - WorldServer world = DimensionManager.getWorld(mDim); - if (world != null) { - if (world.blockExists(mBlockX, mBlockY, mBlockZ)) { - TileEntity tileEntity = world.getTileEntity(mBlockX, mBlockY, mBlockZ); - if (tileEntity instanceof IGregTechTileEntity gtTile) { - if (gtTile.getMetaTileEntity() instanceof IHasFluidDisplayItem) { - ((IHasFluidDisplayItem) gtTile.getMetaTileEntity()).updateFluidDisplayItem(); - } - } - } - } - } -} |