Search in sources :

Example 1 with TileDemonCrucible

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);
}
Also used : TileDemonCrucible(WayofTime.bloodmagic.tile.TileDemonCrucible)

Example 2 with TileDemonCrucible

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;
}
Also used : IDiscreteDemonWill(WayofTime.bloodmagic.soul.IDiscreteDemonWill) IDemonWillGem(WayofTime.bloodmagic.soul.IDemonWillGem) TileDemonCrucible(WayofTime.bloodmagic.tile.TileDemonCrucible) ItemStack(net.minecraft.item.ItemStack)

Aggregations

TileDemonCrucible (WayofTime.bloodmagic.tile.TileDemonCrucible)2 IDemonWillGem (WayofTime.bloodmagic.soul.IDemonWillGem)1 IDiscreteDemonWill (WayofTime.bloodmagic.soul.IDiscreteDemonWill)1 ItemStack (net.minecraft.item.ItemStack)1