Fix issue with EntityDamageByEntityEvents & Offline Players

This commit is contained in:
GJ 2012-06-28 08:14:14 -04:00
parent 0c1a8eff85
commit 565ef693ce

View File

@ -75,11 +75,19 @@ public class EntityListener implements Listener {
} }
} }
if (attacker instanceof Player && defender instanceof Player) { if (defender instanceof Player) {
if (PartyManager.getInstance().inSameParty((Player) defender, (Player) attacker)) { Player defendingPlayer = (Player) defender;
event.setCancelled(true);
if (!defendingPlayer.isOnline()) {
return; return;
} }
if (attacker instanceof Player) {
if (PartyManager.getInstance().inSameParty(defendingPlayer, (Player) attacker)) {
event.setCancelled(true);
return;
}
}
} }
/* Check for invincibility */ /* Check for invincibility */