allow interface itemstack handler to accept over sized stacks

This commit is contained in:
PrototypeTrousers
2022-10-12 17:40:25 -03:00
parent 2e9a5dc8ea
commit 4bac5f43db
9 changed files with 124 additions and 16 deletions
@@ -222,6 +222,18 @@ public final class ContainerInterfaceConfigurationTerminal extends AEBaseContain
ItemHandlerUtil.setStackInSlot(theSlot, 0, player.inventory.getItemStack().copy());
}
break;
case HALVE:
if (inSlot.getCount() > 1) {
ItemStack halved = inSlot.copy();
halved.setCount(inSlot.getCount() / 2);
ItemHandlerUtil.setStackInSlot(theSlot, 0, halved);
}
break;
case DOUBLE:
ItemStack doubled = inSlot.copy();
doubled.setCount(Math.min(512, inSlot.getCount() * 2));
ItemHandlerUtil.setStackInSlot(theSlot, 0, doubled);
break;
default:
return;