From 9f9de86d2181deb153ef44db969182a1248c7fd7 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sun, 16 Feb 2014 00:11:15 +0100 Subject: [PATCH] The defender isn't necessarily a player here MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Besides, the defender doesn’t need to have the player data key anyways --- src/main/java/com/gmail/nossr50/listeners/EntityListener.java | 2 +- src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index e3192c55e..9058833ca 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -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; } diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index bbb3e712b..f385f2224 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -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; }