Fix dropping backpack keeping GUI open (#98)

This commit is contained in:
Algent authored and GitHub committed 2026-06-28 03:16:47 +02:00
1 parent a0f95ee27b
commit c8d5cf92d2
1 file changed
+24
@@ -43,6 +43,30 @@ public class ContainerIchorPouch extends ContainerPlayerInv {
} catch (Exception ignored) {}
}
@Override
public void initPlayerInv() {
int ys = getInvYStart();
int xs = getInvXStart();
int held = player.inventory.currentItem;
for (int x = 0; x < 3; ++x) for (int y = 0; y < 9; ++y)
addSlotToContainer(new Slot(player.inventory, y + x * 9 + 9, xs + y * 18, ys + x * 18));
for (int x = 0; x < 9; ++x) {
if (x == held) {
addSlotToContainer(new Slot(player.inventory, x, xs + x * 18, ys + 58) {
@Override
public boolean canTakeStack(EntityPlayer p) {
return false;
}
});
} else {
addSlotToContainer(new Slot(player.inventory, x, xs + x * 18, ys + 58));
}
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) {
if (slot == blockSlot) return null;