Combat ignores events where entity is dead now.

This commit is contained in:
nossr50 2012-02-22 18:43:09 -08:00
parent a3f0de1c84
commit e4d312a11f
2 changed files with 2 additions and 3 deletions

View File

@ -42,7 +42,7 @@ public class Combat
{ {
public static void combatChecks(EntityDamageEvent event, mcMMO pluginx) public static void combatChecks(EntityDamageEvent event, mcMMO pluginx)
{ {
if(event.isCancelled() || event.getDamage() == 0) if(event.isCancelled() || event.getDamage() == 0 || event.getEntity().isDead())
return; return;
if(event instanceof EntityDamageByEntityEvent) if(event instanceof EntityDamageByEntityEvent)

View File

@ -35,7 +35,7 @@ public class Taming
{ {
public static void rewardXp(EntityDamageEvent event, mcMMO pluginx, Player master) public static void rewardXp(EntityDamageEvent event, mcMMO pluginx, Player master)
{ {
if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity().getEntityId())) if(!pluginx.misc.mobSpawnerList.contains(event.getEntity().getEntityId()))
{ {
int xp = Combat.getXp(event.getEntity(), event); int xp = Combat.getXp(event.getEntity(), event);
Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master); Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master);
@ -51,7 +51,6 @@ public class Taming
public static void fastFoodService(PlayerProfile PPo, Wolf theWolf, EntityDamageEvent event) public static void fastFoodService(PlayerProfile PPo, Wolf theWolf, EntityDamageEvent event)
{ {
//Fast Food Service
if(PPo.getSkillLevel(SkillType.TAMING) >= 50) if(PPo.getSkillLevel(SkillType.TAMING) >= 50)
{ {
if(theWolf.getHealth() < theWolf.getMaxHealth()) if(theWolf.getHealth() < theWolf.getMaxHealth())