Treasure chest right-click fix
This commit is contained in:
parent
b0945ccd17
commit
f95fc6e9cc
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue