Prevent splash potions from hurting other players.
This commit is contained in:
@@ -771,13 +771,11 @@ public class ArenaListener
|
|||||||
for (PotionEffect effect : potion.getEffects()) {
|
for (PotionEffect effect : potion.getEffects()) {
|
||||||
PotionEffectType type = effect.getType();
|
PotionEffectType type = effect.getType();
|
||||||
if (type.equals(PotionEffectType.HARM) || type.equals(PotionEffectType.POISON)) {
|
if (type.equals(PotionEffectType.HARM) || type.equals(PotionEffectType.POISON)) {
|
||||||
Set<LivingEntity> players = new HashSet<LivingEntity>();
|
|
||||||
for (LivingEntity le : event.getAffectedEntities()) {
|
for (LivingEntity le : event.getAffectedEntities()) {
|
||||||
if (le instanceof Player) {
|
if (le instanceof Player) {
|
||||||
players.add(le);
|
event.setIntensity(le, 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.getAffectedEntities().removeAll(players);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user