The defender isn't necessarily a player here

Besides, the defender doesn’t need to have the player data key anyways
This commit is contained in:
TfT_02 2014-02-16 00:11:15 +01:00
parent d9c04a09ba
commit 9f9de86d21
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ public class EntityListener implements Listener {
return;
}
if (!UserManager.hasPlayerDataKey(defender) || !defender.isValid() || !(defender instanceof LivingEntity)) {
if (Misc.isNPCEntity(defender) || !defender.isValid() || !(defender instanceof LivingEntity)) {
return;
}

View File

@ -197,7 +197,7 @@ public final class CombatUtils {
if (attacker instanceof Player && entityType == EntityType.PLAYER) {
Player player = (Player) attacker;
if (Misc.isNPCEntity(player)) {
if (!UserManager.hasPlayerDataKey(player)) {
return;
}