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;
}
}
Aggregations