diff --git a/README.md b/README.md index 1ae5498d3..cab2be272 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # TechReborn + +[![Build Status](http://modmuss50.me:8080/buildStatus/icon?job=TechReborn)](http://modmuss50.me:8080/job/TechReborn/) diff --git a/src/main/java/techreborn/tiles/TileQuantumChest.java b/src/main/java/techreborn/tiles/TileQuantumChest.java index 70c84baa0..71302527e 100644 --- a/src/main/java/techreborn/tiles/TileQuantumChest.java +++ b/src/main/java/techreborn/tiles/TileQuantumChest.java @@ -33,53 +33,55 @@ public class TileQuantumChest extends TileMachineBase implements IInventory, @Override public void updateEntity() { - if (storedItem != null) - { - ItemStack fakeStack = storedItem.copy(); - fakeStack.stackSize = 1; - setInventorySlotContents(2, fakeStack); - } else - { - setInventorySlotContents(2, null); - } - - if (getStackInSlot(0) != null) - { - if (storedItem == null) + if(!worldObj.isRemote){ + if (storedItem != null) { - storedItem = getStackInSlot(0); - setInventorySlotContents(0, null); - } else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), - true, true)) - { - if (storedItem.stackSize <= Integer.MAX_VALUE - - getStackInSlot(0).stackSize) - { - storedItem.stackSize += getStackInSlot(0).stackSize; - decrStackSize(0, getStackInSlot(0).stackSize); - } - } - } - - if (storedItem != null && getStackInSlot(1) == null) - { - ItemStack itemStack = storedItem.copy(); - itemStack.stackSize = itemStack.getMaxStackSize(); - setInventorySlotContents(1, itemStack); - storedItem.stackSize -= itemStack.getMaxStackSize(); - } else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, - true)) - { - int wanted = getStackInSlot(1).getMaxStackSize() - - getStackInSlot(1).stackSize; - if (storedItem.stackSize >= wanted) - { - decrStackSize(1, -wanted); - storedItem.stackSize -= wanted; + ItemStack fakeStack = storedItem.copy(); + fakeStack.stackSize = 1; + setInventorySlotContents(2, fakeStack); } else { - decrStackSize(1, -storedItem.stackSize); - storedItem = null; + setInventorySlotContents(2, null); + } + + if (getStackInSlot(0) != null) + { + if (storedItem == null) + { + storedItem = getStackInSlot(0); + setInventorySlotContents(0, null); + } else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), + true, true)) + { + if (storedItem.stackSize <= Integer.MAX_VALUE + - getStackInSlot(0).stackSize) + { + storedItem.stackSize += getStackInSlot(0).stackSize; + decrStackSize(0, getStackInSlot(0).stackSize); + } + } + } + + if (storedItem != null && getStackInSlot(1) == null) + { + ItemStack itemStack = storedItem.copy(); + itemStack.stackSize = itemStack.getMaxStackSize(); + setInventorySlotContents(1, itemStack); + storedItem.stackSize -= itemStack.getMaxStackSize(); + } else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, + true)) + { + int wanted = getStackInSlot(1).getMaxStackSize() + - getStackInSlot(1).stackSize; + if (storedItem.stackSize >= wanted) + { + decrStackSize(1, -wanted); + storedItem.stackSize -= wanted; + } else + { + decrStackSize(1, -storedItem.stackSize); + storedItem = null; + } } } syncWithAll();