close container if parent item is gone (#45)

This commit is contained in:
Glease authored and GitHub committed 2025-03-11 09:37:18 -05:00
1 parent db796ae830
commit 3809971825
1 file changed
+11
@@ -45,6 +45,17 @@ public class ContainerIchorPouch extends ContainerPlayerInv {
} catch (Exception ignored) {}
}
@Override
public void detectAndSendChanges() {
if (!player.worldObj.isRemote) {
if (player.getCurrentEquippedItem() != pouch) {
player.closeScreen();
return;
}
}
super.detectAndSendChanges();
}
@Override
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) {
if (slot == blockSlot) return null;