Bug Fix: Players not in a party would cause a null pointer exception during a pvp kill.

This commit is contained in:
nossr50 2011-02-04 20:58:21 -08:00
parent 18bc3fec4a
commit 6feb824940

View File

@ -25,9 +25,9 @@ public class mcEntityListener extends EntityListener {
//If defender is player
if(x instanceof Player){
Player defender = (Player)x;
if(mcUsers.getProfile(defender).getParty().equals(mcUsers.getProfile(attacker).getParty())){
if(mcUsers.getProfile(defender).inParty() && mcUsers.getProfile(defender).getParty().equals(mcUsers.getProfile(attacker).getParty()))
event.setCancelled(true);
}
if(mcUsers.getProfile(defender).isDead())
return;
if((defender.getHealth() - event.getDamage()) <= 0){