From 589d94894ec960b0ce0c6462f08dd5933522882f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 8 Jul 2016 13:59:28 +0200 Subject: [PATCH] InvTweaks pls Closes #145 --- .../mod/inventory/gui/GuiGiantChest.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java index 769a80037..e556a286b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java @@ -62,14 +62,16 @@ public class GuiGiantChest extends GuiContainer{ @Override protected void actionPerformed(GuiButton button) throws IOException{ - NBTTagCompound compound = new NBTTagCompound(); - compound.setInteger("X", this.chest.getPos().getX()); - compound.setInteger("Y", this.chest.getPos().getY()); - compound.setInteger("Z", this.chest.getPos().getZ()); - compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); - compound.setInteger("WorldID", this.chest.getWorld().provider.getDimension()); - compound.setInteger("ButtonID", button.id); - PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); + if(button.id >= 0 && button.id < 3){ + NBTTagCompound compound = new NBTTagCompound(); + compound.setInteger("X", this.chest.getPos().getX()); + compound.setInteger("Y", this.chest.getPos().getY()); + compound.setInteger("Z", this.chest.getPos().getZ()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("WorldID", this.chest.getWorld().provider.getDimension()); + compound.setInteger("ButtonID", button.id); + PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); + } } @Override