Search in sources :

Example 1 with ActivationCrystal

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;
}
Also used : Item(net.minecraft.item.Item) ActivationCrystal(WayofTime.alchemicalWizardry.common.items.ActivationCrystal) TEMasterStone(WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ActivationCrystal (WayofTime.alchemicalWizardry.common.items.ActivationCrystal)1 TEMasterStone (WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1