mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-27 20:59:16 +01:00
Prevent players in peaceful factions from damaging with harmful potions. Fixes issue #50.
This commit is contained in:
parent
bf6a3c2a4b
commit
eceb10c185
@ -205,6 +205,15 @@ public class FactionsEntityListener implements Listener {
|
|||||||
return;
|
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
|
// scan through affected entities to make sure they're all valid targets
|
||||||
Iterator<LivingEntity> iter = event.getAffectedEntities().iterator();
|
Iterator<LivingEntity> iter = event.getAffectedEntities().iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user