Handle healthbars even when skills are disabled. Fixes #1194

This commit is contained in:
GJ
2014-03-03 10:29:14 -05:00
parent 7b3869e385
commit 30f7521a3a
3 changed files with 16 additions and 9 deletions

View File

@ -189,6 +189,7 @@ public class EntityListener implements Listener {
}
CombatUtils.processCombatAttack(event, attacker, target);
CombatUtils.handleHealthbars(attacker, target, event.getDamage());
}
/**

View File

@ -298,15 +298,6 @@ public final class CombatUtils {
}
}
}
else if (attacker instanceof Player) {
Player player = (Player) attacker;
if (Misc.isNPCEntity(player) || Misc.isNPCEntity(target)) {
return;
}
MobHealthbarUtils.handleMobHealthbars(player, target, event.getDamage());
}
}
/**
@ -614,4 +605,18 @@ public final class CombatUtils {
return tier;
}
public static void handleHealthbars(Entity attacker, LivingEntity target, double damage) {
if (!(attacker instanceof Player)) {
return;
}
Player player = (Player) attacker;
if (Misc.isNPCEntity(player) || Misc.isNPCEntity(target)) {
return;
}
MobHealthbarUtils.handleMobHealthbars(player, target, damage);
}
}