From 4ae675aebc3cab064b0d83db78fcca683910e834 Mon Sep 17 00:00:00 2001 From: abel1502 Date: Mon, 2 Jun 2025 18:30:35 +0300 Subject: [PATCH] Fix autocrafter output slot This is the only case I found where a SlotPattern was supposed to support a stack size different from 1, but if there's any more, just add a `, true` to the end of the corresponsing slot constructor --- src/main/java/com/hbm/inventory/SlotPattern.java | 11 ++++++++++- .../hbm/inventory/container/ContainerAutocrafter.java | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/inventory/SlotPattern.java b/src/main/java/com/hbm/inventory/SlotPattern.java index 550fae5b6..a6957c7ac 100644 --- a/src/main/java/com/hbm/inventory/SlotPattern.java +++ b/src/main/java/com/hbm/inventory/SlotPattern.java @@ -10,10 +10,17 @@ import net.minecraft.item.ItemStack; public class SlotPattern extends Slot { protected boolean canHover = true; + + protected boolean allowStackSize = false; public SlotPattern(IInventory inv, int index, int x, int y) { super(inv, index, x, y); } + + public SlotPattern(IInventory inv, int index, int x, int y, boolean allowStackSize) { + super(inv, index, x, y); + this.allowStackSize = allowStackSize; + } @Override public boolean canTakeStack(EntityPlayer player) { @@ -29,7 +36,9 @@ public class SlotPattern extends Slot { public void putStack(ItemStack stack) { if (stack != null) { stack = stack.copy(); - stack.stackSize = 1; + + if (!allowStackSize) + stack.stackSize = 1; } super.putStack(stack); } diff --git a/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java b/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java index f18f83c9f..2c8b0438b 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java +++ b/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java @@ -24,7 +24,7 @@ public class ContainerAutocrafter extends ContainerBase { this.addSlotToContainer(new SlotPattern(tedf, j + i * 3, 44 + j * 18, 22 + i * 18)); } } - this.addSlotToContainer(new SlotPattern(tedf, 9, 116, 40)); + this.addSlotToContainer(new SlotPattern(tedf, 9, 116, 40, true)); /* RECIPE */ addSlots(tedf,10, 44, 86, 3, 3);