From cb9a9282ddb9cbad091c46e159ea7a0ae9dfc8b7 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 2 Mar 2012 16:34:35 -0800 Subject: [PATCH] Moving the FakeEntityDamageByEntity event to the top of the listener --- src/main/java/com/gmail/nossr50/Combat.java | 11 ++++------- .../com/gmail/nossr50/listeners/mcEntityListener.java | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index b14173636..47feee2f7 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -67,7 +67,7 @@ public class Combat if(!pluginx.misc.bleedTracker.contains(target)) //Bleed Swords.bleedCheck(attacker, target, pluginx); - if (!(event instanceof FakeEntityDamageByEntityEvent) && PPa.getSerratedStrikesMode()) + if (PPa.getSerratedStrikesMode()) Swords.applySerratedStrikes(attacker, event, pluginx); if(target instanceof Player) @@ -82,13 +82,10 @@ public class Combat Axes.axeCriticalCheck(attacker, event, pluginx); //Critical hit //Impact - if(!(event instanceof FakeEntityDamageByEntityEvent)) - { - Axes.impact(attacker, target); + Axes.impact(attacker, target); - if (PPa.getSkullSplitterMode()) - Axes.applyAoeDamage(attacker, event, pluginx); - } + if (PPa.getSkullSplitterMode()) + Axes.applyAoeDamage(attacker, event, pluginx); if(target instanceof Player) PvPExperienceGain(attacker, PPa, (Player) target, event.getDamage(), SkillType.AXES); diff --git a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java index 8e4465270..6bbfc1230 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java @@ -46,6 +46,7 @@ import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; +import com.gmail.nossr50.events.FakeEntityDamageByEntityEvent; import com.gmail.nossr50.party.Party; import com.gmail.nossr50.skills.Acrobatics; import com.gmail.nossr50.skills.Archery; @@ -65,6 +66,10 @@ public class mcEntityListener implements Listener @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { + //Lets just put this here... + if(event instanceof FakeEntityDamageByEntityEvent) + return; + Entity defender = event.getEntity(); Entity attacker = event.getDamager();