Don't allow chest upgrades to bypass the locks users have put on their chests.
This commit is contained in:
parent
d85e2b425f
commit
24fe8801a3
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue