diff options
Diffstat (limited to 'src/main/java/gregtech/api/gui/GT_Container.java')
-rw-r--r-- | src/main/java/gregtech/api/gui/GT_Container.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java index 614d459cb9..8eb908ecae 100644 --- a/src/main/java/gregtech/api/gui/GT_Container.java +++ b/src/main/java/gregtech/api/gui/GT_Container.java @@ -124,7 +124,7 @@ public class GT_Container extends Container { if ((aShifthold == 0 || aShifthold == 1) && (aMouseclick == 0 || aMouseclick == 1)) { if (aSlotIndex == -999) { - if (aPlayerInventory.getItemStack() != null && aSlotIndex == -999) { + if (aPlayerInventory.getItemStack() != null) { if (aMouseclick == 0) { aPlayer.dropPlayerItemWithRandomChoice(aPlayerInventory.getItemStack(), true); aPlayerInventory.setItemStack(null); @@ -228,11 +228,11 @@ public class GT_Container extends Container { var9 |= tTempStackSize > -1; } - if (aSlot.getHasStack() && var9) { + if (var9 && aSlot.getHasStack()) { aHoldStack = aSlot.getStack(); aPlayerInventory.setInventorySlotContents(aMouseclick, aHoldStack); - if ((aSlot.inventory != aPlayerInventory || !aSlot.isItemValid(tTempStack)) && tTempStack != null) { + if (tTempStack != null && (aSlot.inventory != aPlayerInventory || !aSlot.isItemValid(tTempStack))) { if (tTempStackSize > -1) { aPlayerInventory.addItemStackToInventory(tTempStack); aSlot.decrStackSize(aHoldStack.stackSize); @@ -244,7 +244,7 @@ public class GT_Container extends Container { aSlot.putStack(tTempStack); aSlot.onPickupFromSlot(aPlayer, aHoldStack); } - } else if (!aSlot.getHasStack() && tTempStack != null && aSlot.isItemValid(tTempStack)) { + } else if (tTempStack != null && !aSlot.getHasStack() && aSlot.isItemValid(tTempStack)) { aPlayerInventory.setInventorySlotContents(aMouseclick, (ItemStack) null); aSlot.putStack(tTempStack); } @@ -267,8 +267,7 @@ public class GT_Container extends Container { mTileEntity.markDirty(); - //null checks and checks if the item can be stacked (maxStackSize > 1) - if (getSlotCount() > 0 && slotObject != null && slotObject.getHasStack() && !(slotObject instanceof GT_Slot_Holo)) { + if (getSlotCount() > 0 && !(slotObject instanceof GT_Slot_Holo) && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = GT_Utility.copy(stackInSlot); |