From 8da02383c192b6bbf87972f042cfe4fe0b6a2b50 Mon Sep 17 00:00:00 2001 From: MistPhizzle Date: Sun, 24 Aug 2014 11:05:07 -0400 Subject: [PATCH] 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 --- .../ProjectKorra/airbending/BreathSphere.java | 13 +++++++++++++ src/plugin.yml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/com/projectkorra/ProjectKorra/airbending/BreathSphere.java b/src/com/projectkorra/ProjectKorra/airbending/BreathSphere.java index a3c4c64b..12119dff 100644 --- a/src/com/projectkorra/ProjectKorra/airbending/BreathSphere.java +++ b/src/com/projectkorra/ProjectKorra/airbending/BreathSphere.java @@ -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); } diff --git a/src/plugin.yml b/src/plugin.yml index 43da76f5..d15d465b 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -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.