Search in sources :

Example 1 with EnergySword

use of WayofTime.alchemicalWizardry.common.items.EnergySword in project BloodMagic by WayofTime.

the class AlchemicalWizardryEventHooks method onEntityInteractEvent.

@SubscribeEvent
public void onEntityInteractEvent(EntityInteractEvent event) {
    EntityPlayer player = event.entityPlayer;
    OmegaParadigm parad = OmegaRegistry.getOmegaParadigmOfWeilder(player);
    if (parad == null) {
        return;
    }
    ItemStack heldItem = player.getHeldItem();
    if (heldItem == null) {
        parad.onEmptyHandEntityInteract(player, event.target);
    } else {
        if (heldItem.getItem() instanceof EnergySword) {
            parad.onBoundSwordInteractWithEntity(player, event.target);
        }
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) EnergySword(WayofTime.alchemicalWizardry.common.items.EnergySword) OmegaParadigm(WayofTime.alchemicalWizardry.common.omega.OmegaParadigm) ItemStack(net.minecraft.item.ItemStack) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

EnergySword (WayofTime.alchemicalWizardry.common.items.EnergySword)1 OmegaParadigm (WayofTime.alchemicalWizardry.common.omega.OmegaParadigm)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1