Search in sources :

Example 1 with BuffEffectTemporalAnchor

use of am2.buffs.BuffEffectTemporalAnchor in project ArsMagica2 by Mithion.

the class AMEventHandler method onEntityDeathChrono.

@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onEntityDeathChrono(LivingDeathEvent event) {
    EntityLivingBase soonToBeDead = event.entityLiving;
    if (soonToBeDead.isPotionActive(BuffList.temporalAnchor.id)) {
        event.setCanceled(true);
        PotionEffect pe = soonToBeDead.getActivePotionEffect(BuffList.temporalAnchor);
        if (pe instanceof BuffEffectTemporalAnchor) {
            BuffEffectTemporalAnchor buff = (BuffEffectTemporalAnchor) pe;
            buff.stopEffect(soonToBeDead);
        }
        soonToBeDead.removePotionEffect(BuffList.temporalAnchor.id);
        return;
    }
}
Also used : PotionEffect(net.minecraft.potion.PotionEffect) BuffEffectTemporalAnchor(am2.buffs.BuffEffectTemporalAnchor) SubscribeEvent(cpw.mods.fml.common.eventhandler.SubscribeEvent)

Aggregations

BuffEffectTemporalAnchor (am2.buffs.BuffEffectTemporalAnchor)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 PotionEffect (net.minecraft.potion.PotionEffect)1