Don't allow chest upgrades to bypass the locks users have put on their chests.

This commit is contained in:
alexbegt 2019-12-30 21:37:51 -05:00
parent d85e2b425f
commit 24fe8801a3
1 changed files with 10 additions and 0 deletions

View File

@ -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;