mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
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:
parent
5d7fc996e5
commit
4ae675aebc
@ -10,10 +10,17 @@ import net.minecraft.item.ItemStack;
|
|||||||
public class SlotPattern extends Slot {
|
public class SlotPattern extends Slot {
|
||||||
|
|
||||||
protected boolean canHover = true;
|
protected boolean canHover = true;
|
||||||
|
|
||||||
|
protected boolean allowStackSize = false;
|
||||||
|
|
||||||
public SlotPattern(IInventory inv, int index, int x, int y) {
|
public SlotPattern(IInventory inv, int index, int x, int y) {
|
||||||
super(inv, index, x, 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
|
@Override
|
||||||
public boolean canTakeStack(EntityPlayer player) {
|
public boolean canTakeStack(EntityPlayer player) {
|
||||||
@ -29,7 +36,9 @@ public class SlotPattern extends Slot {
|
|||||||
public void putStack(ItemStack stack) {
|
public void putStack(ItemStack stack) {
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
stack = stack.copy();
|
stack = stack.copy();
|
||||||
stack.stackSize = 1;
|
|
||||||
|
if (!allowStackSize)
|
||||||
|
stack.stackSize = 1;
|
||||||
}
|
}
|
||||||
super.putStack(stack);
|
super.putStack(stack);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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, 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 */
|
/* RECIPE */
|
||||||
addSlots(tedf,10, 44, 86, 3, 3);
|
addSlots(tedf,10, 44, 86, 3, 3);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user