From cfcc8a6435c7c6e81a03b8691e000900ba3a6696 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sat, 9 May 2015 19:06:17 -0400 Subject: [PATCH] Clean up double chest meta logic --- src/main/java/crazypants/enderio/item/ItemYetaWrench.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/crazypants/enderio/item/ItemYetaWrench.java b/src/main/java/crazypants/enderio/item/ItemYetaWrench.java index 1e3e8670..e66203ab 100644 --- a/src/main/java/crazypants/enderio/item/ItemYetaWrench.java +++ b/src/main/java/crazypants/enderio/item/ItemYetaWrench.java @@ -90,9 +90,7 @@ public class ItemYetaWrench extends Item implements ITool, IConduitControl, IAdv TileEntityChest masterChest = te.adjacentChestXNeg == null && te.adjacentChestZNeg == null ? te : te.adjacentChestXNeg == null ? te.adjacentChestZNeg: te.adjacentChestXNeg; if (masterChest != te) { int meta = world.getBlockMetadata(masterChest.xCoord, masterChest.yCoord, masterChest.zCoord); - // Black magic - int newMeta = meta + (meta % 2 == 0 ? 1 : -1); - world.setBlockMetadataWithNotify(masterChest.xCoord, masterChest.yCoord, masterChest.zCoord, newMeta, 3); + world.setBlockMetadataWithNotify(masterChest.xCoord, masterChest.yCoord, masterChest.zCoord, meta ^ 1, 3); } else { // If this is the master chest, we can just rotate twice block.rotateBlock(world, x, y, z, ForgeDirection.getOrientation(side));