From b3632e66bbd2aa6abd7939166fde3f09eddbf432 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Wed, 22 Oct 2014 17:37:27 +0200 Subject: [PATCH] Fix InventoryCraftingStation accessing incorrect slots, that can sometimes lead to invalid accesses/crahes with some crafting stuff now. --- .../tconstruct/tools/inventory/InventoryCraftingStation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/tconstruct/tools/inventory/InventoryCraftingStation.java b/src/main/java/tconstruct/tools/inventory/InventoryCraftingStation.java index f301336d..fe19d842 100644 --- a/src/main/java/tconstruct/tools/inventory/InventoryCraftingStation.java +++ b/src/main/java/tconstruct/tools/inventory/InventoryCraftingStation.java @@ -37,7 +37,8 @@ public class InventoryCraftingStation extends InventoryCrafting @Override public ItemStack getStackInSlot (int slot) { - return slot >= this.getSizeInventory() + 1 ? null : logic.getStackInSlot(slot + 1); + // the 9 slots + 1 output slot that's not accessible, we therefore have to add 1 to the slot accessed + return slot > this.getSizeInventory() ? null : logic.getStackInSlot(slot+1); } @Override