Fix WCT invisible stacksizes, OOB when opening pattern terminal

FIx security station card slot being reaaally off
This commit is contained in:
PrototypeTrousers
2022-10-18 23:56:40 -03:00
parent 15a1e8f150
commit 0e0729166f
6 changed files with 30 additions and 28 deletions
@@ -46,6 +46,7 @@ public class AppEngSlot extends Slot {
private int IIcon = -1;
private hasCalculatedValidness isValid;
private boolean isDisplay = false;
private boolean returnAsSingleStack;
public AppEngSlot(final IItemHandler inv, final int idx, final int x, final int y) {
super(emptyInventory, idx, x, y);
@@ -94,16 +95,29 @@ public class AppEngSlot extends Slot {
return ItemStack.EMPTY;
}
if (this.isDisplay()) {
this.setDisplay(false);
ItemStack retStack = this.getDisplayStack().copy();
retStack.setCount(1);
return retStack;
if (this.returnAsSingleStack()) {
setReturnAsSingleStack(false);
ItemStack ret = this.getDisplayStack().copy();
ret.setCount(1);
return ret;
}
return this.getDisplayStack();
}
return this.itemHandler.getStackInSlot(this.index);
}
private boolean returnAsSingleStack() {
return this.returnAsSingleStack;
}
public void setReturnAsSingleStack(boolean returnAsSingleStack) {
this.returnAsSingleStack = returnAsSingleStack;
}
@Override
public void putStack(final ItemStack stack) {
if (this.isSlotEnabled()) {