From 8b4e7f7ec300fee827443b3b4365c75ee0afde06 Mon Sep 17 00:00:00 2001 From: EmperorSuper <26164930+EmperorSuper@users.noreply.github.com> Date: Wed, 24 Sep 2025 12:10:22 +0300 Subject: [PATCH] Cap the length of the baubles inventory (#202) --- .../enderio/machine/capbank/ContainerCapBank.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/crazypants/enderio/machine/capbank/ContainerCapBank.java b/src/main/java/crazypants/enderio/machine/capbank/ContainerCapBank.java index 5f3dfef5..95e0500a 100644 --- a/src/main/java/crazypants/enderio/machine/capbank/ContainerCapBank.java +++ b/src/main/java/crazypants/enderio/machine/capbank/ContainerCapBank.java @@ -89,7 +89,9 @@ public class ContainerCapBank extends ContainerEnderTileEntity { } if (hasBaublesSlots()) { - for (int i = 0; i < baubles.getSizeInventory(); i++) { + // for (int i = 0; i < baubles.getSizeInventory(); i++) { + // Capped since the sprite only has 4 slots + for (int i = 0; i < Math.min(baubles.getSizeInventory(), 4); i++) { addSlotToContainer(new Slot(baubles, i, -15 + armorOffset, 84 + i * 18) { @Override @@ -122,7 +124,9 @@ public class ContainerCapBank extends ContainerEnderTileEntity { int startHotBarSlot = endPlayerSlot + 1; int endHotBarSlot = startHotBarSlot + 9; int startBaublesSlot = endHotBarSlot + 1; - int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + baubles.getSizeInventory(); + // int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + baubles.getSizeInventory(); + // Capped since the sprite only has 4 slots + int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + Math.min(baubles.getSizeInventory(), 4); ItemStack copystack = null; Slot slot = (Slot) inventorySlots.get(slotIndex);