From 24fe8801a39cbea20dc7459b0078cc08c7329b37 Mon Sep 17 00:00:00 2001 From: alexbegt Date: Mon, 30 Dec 2019 21:37:51 -0500 Subject: [PATCH] Don't allow chest upgrades to bypass the locks users have put on their chests. --- .../ironchest/common/items/ChestChangerItem.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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;