From ab40c700036173cd134f74aa63db7f4087371cd4 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Sat, 31 Jan 2015 20:51:35 -0500 Subject: [PATCH] #1630 "Fix" item conduits preserving invalid stack sizes --- .../crazypants/enderio/conduit/item/NetworkedInventory.java | 1 - src/main/java/crazypants/util/ItemUtil.java | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/crazypants/enderio/conduit/item/NetworkedInventory.java b/src/main/java/crazypants/enderio/conduit/item/NetworkedInventory.java index 56005cb4..fa63c0a6 100644 --- a/src/main/java/crazypants/enderio/conduit/item/NetworkedInventory.java +++ b/src/main/java/crazypants/enderio/conduit/item/NetworkedInventory.java @@ -92,7 +92,6 @@ public class NetworkedInventory { } public void onTick(long tick) { - int transfered; if(tickDeficit > 0 || !canExtract() || !con.isExtractionRedstoneConditionMet(conDir)) { //do nothing } else { diff --git a/src/main/java/crazypants/util/ItemUtil.java b/src/main/java/crazypants/util/ItemUtil.java index 81451cba..f974783a 100644 --- a/src/main/java/crazypants/util/ItemUtil.java +++ b/src/main/java/crazypants/util/ItemUtil.java @@ -90,6 +90,7 @@ public class ItemUtil { ItemStack contents = sidedInv.getStackInSlot(slot); ItemStack toInsert = item.copy(); toInsert.stackSize = Math.min(toInsert.stackSize, sidedInv.getInventoryStackLimit()); + toInsert.stackSize = Math.min(toInsert.stackSize, toInsert.getMaxStackSize()); // some inventories like filing cap toInsert.stackSize = Math.min(toInsert.stackSize, numToInsert); int inserted = 0; if(contents == null) { @@ -126,6 +127,7 @@ public class ItemUtil { if(!isStackFull(contents)) { ItemStack toInsert = item.copy(); toInsert.stackSize = Math.min(toInsert.stackSize, inv.getInventoryStackLimit()); + toInsert.stackSize = Math.min(toInsert.stackSize, toInsert.getMaxDamage()); // some inventories like filing cap toInsert.stackSize = Math.min(toInsert.stackSize, numToInsert); int inserted = 0; if(contents == null) {