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
This commit is contained in:
abel1502 2025-06-02 18:30:35 +03:00
parent 5d7fc996e5
commit 4ae675aebc
No known key found for this signature in database
GPG Key ID: 076926596A536338
2 changed files with 11 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);