Prevent players in peaceful factions from damaging with harmful potions. Fixes issue #50.

This commit is contained in:
Ihaveaporpoise 2014-09-30 17:20:06 -05:00 committed by drtshock
parent bf6a3c2a4b
commit eceb10c185

View File

@ -205,6 +205,15 @@ public class FactionsEntityListener implements Listener {
return;
}
if(thrower instanceof Player){
Player player = (Player) thrower;
FPlayer fPlayer = FPlayers.i.get(player);
if(badjuju && fPlayer.getFaction().isPeaceful()){
event.setCancelled(true);
return;
}
}
// scan through affected entities to make sure they're all valid targets
Iterator<LivingEntity> iter = event.getAffectedEntities().iterator();
while (iter.hasNext()) {