diff --git a/common/logisticspipes/proxy/recipeproviders/LogisticsCraftingTable.java b/common/logisticspipes/proxy/recipeproviders/LogisticsCraftingTable.java index 8928aa4b9..2df0d82ff 100644 --- a/common/logisticspipes/proxy/recipeproviders/LogisticsCraftingTable.java +++ b/common/logisticspipes/proxy/recipeproviders/LogisticsCraftingTable.java @@ -1,6 +1,7 @@ package logisticspipes.proxy.recipeproviders; -import net.minecraft.item.ItemStack; +import logisticspipes.utils.tuples.Pair; + import net.minecraft.tileentity.TileEntity; import logisticspipes.blocks.crafting.LogisticsCraftingTableTileEntity; @@ -31,19 +32,15 @@ public boolean importRecipe(TileEntity tile, IItemIdentifierInventory inventory) return false; } + // Craft result is slot 9 inventory.setInventorySlotContents(9, result); - // Import - for (int i = 0; i < bench.matrix.getSizeInventory(); i++) { - if (i >= inventory.getSizeInventory() - 2) { - break; - } - ItemStack stackInSlot = bench.matrix.getStackInSlot(i); - if (!stackInSlot.isEmpty() && stackInSlot.getCount() > 1) { - stackInSlot = stackInSlot.copy(); - stackInSlot.setCount(1); + // Import (Slots [0, 8]) + for (Pair slot : bench.matrix) { + final int i = slot.getValue2(); + if (i <= inventory.getSizeInventory() - 2) { + inventory.setInventorySlotContents(i, slot.getValue1().makeNormalStack()); } - inventory.setInventorySlotContents(i, stackInSlot); } if (!bench.isFuzzy()) {