diff --git a/src/main/java/com/progwml6/ironchest/common/items/ChestChangerItem.java b/src/main/java/com/progwml6/ironchest/common/items/ChestChangerItem.java index 19712cb..3f3ee95 100644 --- a/src/main/java/com/progwml6/ironchest/common/items/ChestChangerItem.java +++ b/src/main/java/com/progwml6/ironchest/common/items/ChestChangerItem.java @@ -89,6 +89,11 @@ public class ChestChangerItem extends TooltipItem IronChestTileEntity chest = (IronChestTileEntity) tileEntity; BlockState chestState = world.getBlockState(blockPos); + if (!chest.canOpen(entityPlayer)) + { + return ActionResultType.PASS; + } + chestContents = chest.getItems(); chestFacing = chestState.get(ChestBlock.FACING); customName = chest.getCustomName(); @@ -110,6 +115,11 @@ public class ChestChangerItem extends TooltipItem return ActionResultType.PASS; } + if(!chest.canOpen(entityPlayer)) + { + return ActionResultType.PASS; + } + if (!this.type.canUpgrade(ChestType.WOOD)) { return ActionResultType.PASS;