Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<ItemIdentifierStack, Integer> slot : bench.matrix) {
final int i = slot.getValue2();
if (i <= inventory.getSizeInventory() - 2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not exactly sure why inventory size - 2 would be okay here in the new code, but not previously? Can you elaborate?

inventory.setInventorySlotContents(i, slot.getValue1().makeNormalStack());
}
inventory.setInventorySlotContents(i, stackInSlot);
}

if (!bench.isFuzzy()) {
Expand Down