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,12 +75,20 @@ public class EntityListener implements Listener {
}
}
if (attacker instanceof Player && defender instanceof Player) {
if (PartyManager.getInstance().inSameParty((Player) defender, (Player) attacker)) {
if (defender instanceof Player) {
Player defendingPlayer = (Player) defender;
if (!defendingPlayer.isOnline()) {
return;
}
if (attacker instanceof Player) {
if (PartyManager.getInstance().inSameParty(defendingPlayer, (Player) attacker)) {
event.setCancelled(true);
return;
}
}
}
/* Check for invincibility */
if (defender instanceof LivingEntity) {