use of WayofTime.bloodmagic.iface.IAltarReader in project BloodMagic by WayofTime.
the class BlockAltar method onBlockActivated.
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
TileAltar altar = (TileAltar) world.getTileEntity(pos);
if (altar == null || player.isSneaking())
return false;
ItemStack playerItem = player.getHeldItem(hand);
if (playerItem.getItem() instanceof IAltarReader || playerItem.getItem() instanceof IAltarManipulator) {
playerItem.getItem().onItemRightClick(world, player, hand);
return true;
}
if (Utils.insertItemToTile(altar, player))
altar.startCycle();
else
altar.setActive();
world.notifyBlockUpdate(pos, state, state, 3);
return true;
}
Aggregations