From 145f70c16f93d35778acf58dec1d41f189678910 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 27 Apr 2013 15:21:39 -0300 Subject: [PATCH 1/3] pre compute fix blah blah blah this is a good fix so merge it --- common/buildcraft/factory/TileAutoWorkbench.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/buildcraft/factory/TileAutoWorkbench.java b/common/buildcraft/factory/TileAutoWorkbench.java index 7c880757..50b12aa4 100644 --- a/common/buildcraft/factory/TileAutoWorkbench.java +++ b/common/buildcraft/factory/TileAutoWorkbench.java @@ -100,7 +100,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { for (int slot = 0; slot < this.getSizeInventory(); slot++){ ItemStack item = this.getStackInSlot(slot); - if (item != null && item.stackSize == 1){ + if (item != null && item.stackSize == 1 && !item.getItem().hasContainerItem()){ required[slot] = item.copy(); } } From ec3d44db6f0e56fa40603c81a9a237a0f1201b32 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 27 Apr 2013 15:29:55 -0300 Subject: [PATCH 2/3] Update TileAutoWorkbench.java --- common/buildcraft/factory/TileAutoWorkbench.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/common/buildcraft/factory/TileAutoWorkbench.java b/common/buildcraft/factory/TileAutoWorkbench.java index 50b12aa4..b317d339 100644 --- a/common/buildcraft/factory/TileAutoWorkbench.java +++ b/common/buildcraft/factory/TileAutoWorkbench.java @@ -62,14 +62,14 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { @Override public ItemStack decrStackSize(int slot, int amount) { ItemStack item = this.crafting.decrStackSize(slot, amount); - this.onInventoryChanged(); + super.onInventoryChanged(); return item; } @Override public void setInventorySlotContents(int slot, ItemStack stack) { this.crafting.setInventorySlotContents(slot, stack); - this.onInventoryChanged(); + super.onInventoryChanged(); } @Override @@ -154,21 +154,15 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { ItemStack item = inventory.getStackInSlot(slot); if (item != null){ - boolean refilAll = false; - for (int slot1 = 0; slot1 < this.getSizeInventory(); slot1++){ ItemStack item1 = this.getStackInSlot(slot1); if (item1 != null && item1.stackSize == 1 && item.isItemEqual(item1)){ item1.stackSize++; inventory.decrStackSize(slot, 1); - - if (slot1 == this.getSizeInventory() - 1) refilAll = true; - }else{ - refilAll = false; } + + if (this.canCraft()) return; } - - if (refilAll) return; } } } From f0120931be367d79ba0277f208eb334479ee533a Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 27 Apr 2013 16:07:27 -0300 Subject: [PATCH 3/3] Update TileAutoWorkbench.java --- common/buildcraft/factory/TileAutoWorkbench.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/factory/TileAutoWorkbench.java b/common/buildcraft/factory/TileAutoWorkbench.java index b317d339..bbe04067 100644 --- a/common/buildcraft/factory/TileAutoWorkbench.java +++ b/common/buildcraft/factory/TileAutoWorkbench.java @@ -247,14 +247,14 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory { this.refilFromNeibour(); if (!this.canCraft()){ - return new ItemStack[0]; + return null; } } this.craft(); item = result.copy(); }else{ - return new ItemStack[0]; + return null; } return new ItemStack[] { item };