Treasure chest right-click fix

This commit is contained in:
Kino 2017-11-27 22:47:17 -05:00
parent b0945ccd17
commit f95fc6e9cc

View file

@ -379,10 +379,15 @@ public class BlockTreasureChest extends BlockContainer
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
if (worldIn.isRemote)
{
return true;
}
TileEntityTreasureChest treasurechest = (TileEntityTreasureChest)worldIn.getTileEntity(pos);
ItemStack guiID = heldItem;
if (treasurechest.isLocked())
{
if (guiID == null || guiID != null && guiID.getItem() != ItemsAether.dungeon_key)
@ -390,10 +395,7 @@ public class BlockTreasureChest extends BlockContainer
return false;
}
if (!worldIn.isRemote)
{
treasurechest.unlock(guiID.getItemDamage());
}
treasurechest.unlock(guiID.getItemDamage());
--guiID.stackSize;
}