Fix #201: Worktable crash on shift-clicking items in.

This commit is contained in:
mezz committed 2014-09-19 21:24:51 -07:00
1 parent 48f8244dd1
commit 646e0fdb5a
1 file changed
+6 -2
@@ -461,7 +461,9 @@ public class TileWorktable extends TileBase implements ICrafter {
craftingInventory.setInventorySlotContents(SLOT_CRAFTING_RESULT, null);
}
private boolean validateResources() {
private boolean canCraftCurrentRecipe() {
if (currentRecipe == null)
return false;
ItemStack[] set = craftingInventory.getStacks(SLOT_CRAFTING_1, 9);
ItemStack[] stock = accessibleInventory.getStacks(SLOT_INVENTORY_1, SLOT_INVENTORY_COUNT);
return StackUtils.containsSets(set, stock, currentRecipe.getRecipeOutput(), true, true) > 0;
@@ -474,7 +476,9 @@ public class TileWorktable extends TileBase implements ICrafter {
@Override
public boolean canTakeStack(int slotIndex) {
return validateResources();
if (slotIndex == SLOT_CRAFTING_RESULT)
return canCraftCurrentRecipe();
return true;
}
@Override