From 551de94f7e25a9ad8843445c6a5579c8ba305eba Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Sun, 6 Jan 2019 10:22:09 -0500 Subject: [PATCH] restore previous behavior for airsuction where you could only affect yourself if a origin cloud was set --- .../projectkorra/airbending/AirSuction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/projectkorra/projectkorra/airbending/AirSuction.java b/src/com/projectkorra/projectkorra/airbending/AirSuction.java index cb5d0a33..f1c9565c 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirSuction.java +++ b/src/com/projectkorra/projectkorra/airbending/AirSuction.java @@ -45,6 +45,7 @@ public class AirSuction extends AirAbility { private Location location; private Location origin; private Vector direction; + private boolean canAffectSelf; public AirSuction(final Player player) { super(player); @@ -78,6 +79,7 @@ public class AirSuction extends AirAbility { this.cooldown = getConfig().getLong("Abilities.Air.AirSuction.Cooldown"); this.random = new Random(); this.origin = getTargetLocation(); + this.canAffectSelf = true; if (GeneralMethods.isRegionProtectedFromBuild(player, this.getName(), origin)) { return; @@ -195,6 +197,9 @@ public class AirSuction extends AirAbility { if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || ((entity instanceof Player) && Commands.invincible.contains(((Player) entity).getName()))){ continue; } + if((entity.getEntityId() == player.getEntityId()) && !canAffectSelf){ + continue; + } final Vector velocity = entity.getVelocity(); final double max = this.speed; final Vector push = this.direction.clone(); @@ -269,6 +274,7 @@ public class AirSuction extends AirAbility { } else { suc = new AirSuction(player); suc.setOrigin(player.getEyeLocation().clone()); + suc.setCanEffectSelf(false); } if (suc.getOrigin() != null) { @@ -393,6 +399,10 @@ public class AirSuction extends AirAbility { this.cooldown = cooldown; } + public void setCanEffectSelf(final boolean affect) { + this.canAffectSelf = affect; + } + public static int getSelectParticles() { return getConfig().getInt("Abilities.Air.AirSuction.SelectParticles"); }