Make sure the attacker is a valid player too.

Fixes #1464
This commit is contained in:
GJ 2013-09-16 08:53:55 -04:00
parent 64e1448782
commit 816b08b14a

View File

@ -151,6 +151,10 @@ public class EntityListener implements Listener {
Entity attacker = event.getDamager(); Entity attacker = event.getDamager();
if (Misc.isNPCEntity(attacker)) {
return;
}
if (attacker instanceof Projectile) { if (attacker instanceof Projectile) {
attacker = ((Projectile) attacker).getShooter(); attacker = ((Projectile) attacker).getShooter();
} }