From a53e0cf5d591cbdb8fbac2fdb40b038b31da512b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 20 Oct 2020 18:31:13 +0200 Subject: [PATCH] fixed a crafting terminal overflow if the crafting slots are full --- .../prettypipes/terminal/CraftingTerminalTileEntity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/prettypipes/terminal/CraftingTerminalTileEntity.java b/src/main/java/de/ellpeck/prettypipes/terminal/CraftingTerminalTileEntity.java index 45a9e6b..05b9285 100644 --- a/src/main/java/de/ellpeck/prettypipes/terminal/CraftingTerminalTileEntity.java +++ b/src/main/java/de/ellpeck/prettypipes/terminal/CraftingTerminalTileEntity.java @@ -177,7 +177,10 @@ public class CraftingTerminalTileEntity extends ItemTerminalTileEntity { if (lowestSlot >= 0) { ItemStack copy = remain.copy(); copy.setCount(1); - remain.shrink(1 - tile.craftItems.insertItem(lowestSlot, copy, simulate).getCount()); + // if there were remaining items inserting into the slot with lowest contents, we're overflowing + if (tile.craftItems.insertItem(lowestSlot, copy, simulate).getCount() > 0) + break; + remain.shrink(1); if (remain.isEmpty()) return ItemStack.EMPTY; }