use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method drops.
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void drops(LootingLevelEvent e) {
if (e.getEntityLiving() != null && !e.getEntityLiving().isEffectiveAi())
return;
if (e.getDamageSource().getEntity() instanceof LivingEntity) {
LivingEntity attacker = (LivingEntity) e.getDamageSource().getEntity();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, null));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method gainMightFlagS.
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void gainMightFlagS(GainMightEvent e) {
if (!e.getEntityLiving().isEffectiveAi())
return;
LivingEntity attacker = e.getEntityLiving();
final ISkillCapability cap = CasterData.getCap(e.getEntityLiving());
for (Skill s : cap.getEquippedSkills()) {
cap.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, null));
}
// System.out.println("might "+e.isCanceled());
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method dropse.
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void dropse(LivingDropsEvent e) {
if (e.getEntityLiving() != null && !e.getEntityLiving().isEffectiveAi())
return;
if (e.getSource().getEntity() instanceof LivingEntity) {
LivingEntity attacker = (LivingEntity) e.getSource().getEntity();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, null));
}
}
use of jackiecrazy.wardance.capability.skill.ISkillCapability in project WarDance by Jackiecrazy.
the class SkillEventHandler method knockbackFlagS.
@SubscribeEvent(priority = EventPriority.LOWEST)
public static void knockbackFlagS(MeleeKnockbackEvent e) {
if (!e.getEntityLiving().isEffectiveAi())
return;
if (e.getAttacker() != null) {
LivingEntity attacker = e.getAttacker();
ISkillCapability isc = CasterData.getCap(attacker);
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(attacker, e, d.getState(), d, e.getEntityLiving()));
}
}
ISkillCapability isc = CasterData.getCap(e.getEntityLiving());
for (Skill s : isc.getEquippedSkills()) {
isc.getSkillData(s).ifPresent(d -> s.onProc(e.getEntityLiving(), e, d.getState(), d, e.getAttacker()));
}
}
Aggregations