A bit more altar cleanup
This commit is contained in:
parent
e2d2ecb3ba
commit
ecb81a7017
6 changed files with 108 additions and 108 deletions
|
@ -117,7 +117,7 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
|
|||
if (altar == null || player.isSneaking())
|
||||
return false;
|
||||
|
||||
ItemStack playerItem = player.inventory.getCurrentItem();
|
||||
ItemStack playerItem = player.getHeldItem(hand);
|
||||
|
||||
if (playerItem.getItem() instanceof IAltarReader || playerItem.getItem() instanceof IAltarManipulator) {
|
||||
playerItem.getItem().onItemRightClick(world, player, hand);
|
||||
|
@ -136,11 +136,8 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl
|
|||
@Override
|
||||
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
|
||||
TileEntity tile = world.getTileEntity(blockPos);
|
||||
if (tile instanceof TileAltar) {
|
||||
TileAltar tileAltar = (TileAltar) world.getTileEntity(blockPos);
|
||||
if (tileAltar != null)
|
||||
tileAltar.dropItems();
|
||||
}
|
||||
if (tile instanceof TileAltar)
|
||||
((TileAltar) tile).dropItems();
|
||||
|
||||
super.breakBlock(world, blockPos, blockState);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue