use of WayofTime.bloodmagic.tile.TileDemonCrucible in project BloodMagic by WayofTime.
the class BlockDemonCrucible method breakBlock.
@Override
public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) {
TileDemonCrucible tile = (TileDemonCrucible) world.getTileEntity(blockPos);
if (tile != null)
tile.dropItems();
super.breakBlock(world, blockPos, blockState);
}
use of WayofTime.bloodmagic.tile.TileDemonCrucible in project BloodMagic by WayofTime.
the class BlockDemonCrucible method onBlockActivated.
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
ItemStack heldItem = player.getHeldItem(hand);
TileDemonCrucible crucible = (TileDemonCrucible) world.getTileEntity(pos);
if (crucible == null || player.isSneaking())
return false;
if (!heldItem.isEmpty()) {
if (!(heldItem.getItem() instanceof IDiscreteDemonWill) && !(heldItem.getItem() instanceof IDemonWillGem)) {
return true;
}
}
Utils.insertItemToTile(crucible, player);
world.notifyBlockUpdate(pos, state, state, 3);
return true;
}
Aggregations