Return after we cancel an event

For EntityDamageByEntity and EntityDamage
This commit is contained in:
NuclearW 2012-03-08 13:22:14 -05:00
parent 63bdc16e2f
commit 7a549ce211

View File

@ -60,8 +60,10 @@ public class mcEntityListener implements Listener
{ {
if(!defender.getWorld().getPVP()) if(!defender.getWorld().getPVP())
return; return;
if(Party.getInstance().inSameParty((Player)defender, (Player)attacker)) if(Party.getInstance().inSameParty((Player)defender, (Player)attacker)) {
event.setCancelled(true); event.setCancelled(true);
return;
}
} }
//Make sure defender is not invincible //Make sure defender is not invincible
@ -91,8 +93,10 @@ public class mcEntityListener implements Listener
*/ */
Player player = (Player) entity; Player player = (Player) entity;
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);
if(PP.getGodMode()) if(PP.getGodMode()) {
event.setCancelled(true); event.setCancelled(true);
return;
}
if(!m.isInvincible(player, event)) if(!m.isInvincible(player, event))
{ {