Moving the FakeEntityDamageByEntity event to the top of the listener

This commit is contained in:
nossr50 2012-03-02 16:34:35 -08:00
parent 14f1a91eeb
commit cb9a9282dd
2 changed files with 9 additions and 7 deletions

View File

@ -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);
if (PPa.getSkullSplitterMode())
Axes.applyAoeDamage(attacker, event, pluginx);
}
if(target instanceof Player)
PvPExperienceGain(attacker, PPa, (Player) target, event.getDamage(), SkillType.AXES);

View File

@ -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();