Couple of BreathSphere changes

A player entering the AvatarState will break out of the ability.

A player can't hurt themselves with Breathbending in AvatarState
This commit is contained in:
MistPhizzle 2014-08-24 11:05:07 -04:00
parent 35de391fce
commit 8da02383c1
2 changed files with 14 additions and 1 deletions

View file

@ -98,6 +98,7 @@ public class BreathSphere {
for (Entity entity : Methods.getEntitiesAroundPoint(player.getLocation(), range)) {
if (Methods.isRegionProtectedFromBuild(player, "BreathSphere", entity.getLocation()))
continue;
if (entity.getEntityId() == player.getEntityId()) continue;
entities.add(entity);
if (!targetentities.containsKey(entity) && entity instanceof LivingEntity) {
Methods.damageEntity(player, entity, 0);
@ -111,6 +112,12 @@ public class BreathSphere {
if (entity instanceof Creature) {
((Creature) entity).setTarget(player);
}
if (entity instanceof Player) {
if (AvatarState.isAvatarState((Player) entity)) {
remove(player);
return;
}
}
if (entity.isDead()) {
instances.remove(player);
}
@ -134,6 +141,12 @@ public class BreathSphere {
if (entity instanceof Creature) {
((Creature) entity).setTarget(null);
}
if (entity instanceof Player) {
if (AvatarState.isAvatarState((Player) entity)) {
remove(player);
return;
}
}
if (entity.isDead()) {
instances.remove(player);
}

View file

@ -88,7 +88,7 @@ permissions:
bending.earth.passive: true
bending.earth.metalbending: true
bending.earth.grapplinghook: true
bending.ability.LavaSurge
bending.ability.LavaSurge: true
bending.fire:
default: true
description: Grants access to all firebending abilities.