use of WayofTime.alchemicalWizardry.common.items.ActivationCrystal in project BloodMagic by WayofTime.
the class BlockMasterStone method onBlockActivated.
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are) {
TEMasterStone tileEntity = (TEMasterStone) world.getTileEntity(x, y, z);
if (tileEntity == null || player.isSneaking()) {
return false;
}
ItemStack playerItem = player.getCurrentEquippedItem();
if (playerItem == null) {
return false;
}
Item item = playerItem.getItem();
if (!(item instanceof ActivationCrystal)) {
return false;
}
ActivationCrystal acItem = (ActivationCrystal) item;
// tileEntity.setOwner(acItem.getOwnerName(playerItem));
tileEntity.activateRitual(world, acItem.getCrystalLevel(playerItem), playerItem, player, acItem.getOwnerName(playerItem));
world.markBlockForUpdate(x, y, z);
return true;
}
Aggregations