diff --git a/src/com/projectkorra/ProjectKorra/Methods.java b/src/com/projectkorra/ProjectKorra/Methods.java index e62d441a..02a3ae18 100644 --- a/src/com/projectkorra/ProjectKorra/Methods.java +++ b/src/com/projectkorra/ProjectKorra/Methods.java @@ -502,6 +502,7 @@ public class Methods { public static boolean canBend(String player, String ability) { BendingPlayer bPlayer = getBendingPlayer(player); Player p = Bukkit.getPlayer(player); + if (bPlayer == null) return false; if (!bPlayer.isToggled) return false; if (p == null) return false; if (!p.hasPermission("bending.ability." + ability)) return false; @@ -539,6 +540,8 @@ public class Methods { public static boolean canBendPassive(String player, Element element) { BendingPlayer bPlayer = getBendingPlayer(player); Player p = Bukkit.getPlayer(player); + if (bPlayer == null) return false; + if (p == null) return false; if (!p.hasPermission("bending." + element.toString().toLowerCase() + ".passive")) return false; if (!bPlayer.isToggled) return false; if (!bPlayer.hasElement(element)) return false; @@ -610,7 +613,8 @@ public class Methods { public static String getBoundAbility(Player player) { BendingPlayer bPlayer = getBendingPlayer(player.getName()); - + if (bPlayer == null) return null; + int slot = player.getInventory().getHeldItemSlot() + 1; return bPlayer.abilities.get(slot); } diff --git a/src/com/projectkorra/ProjectKorra/PKListener.java b/src/com/projectkorra/ProjectKorra/PKListener.java index f79e0972..5ec86ad5 100644 --- a/src/com/projectkorra/ProjectKorra/PKListener.java +++ b/src/com/projectkorra/ProjectKorra/PKListener.java @@ -274,10 +274,6 @@ public class PKListener implements Listener { if (!player.isSneaking() && Methods.canBend(player.getName(), abil)) { - if (abil.equalsIgnoreCase("AirShield")) { - new AirShield(player); - } - if (Methods.isAirAbility(abil)) { if (Methods.isWeapon(player.getItemInHand().getType()) && !plugin.getConfig().getBoolean("Properties.Air.CanBendWithWeapons")) { return; @@ -297,6 +293,10 @@ public class PKListener implements Listener { if (abil.equalsIgnoreCase("AirSwipe")) { AirSwipe.charge(player); } + if (abil.equalsIgnoreCase("AirShield")) { + new AirShield(player); + } + } if (Methods.isWaterAbility(abil)) { diff --git a/src/com/projectkorra/ProjectKorra/waterbending/IceSpike.java b/src/com/projectkorra/ProjectKorra/waterbending/IceSpike.java index a4b7c5f2..a2750060 100644 --- a/src/com/projectkorra/ProjectKorra/waterbending/IceSpike.java +++ b/src/com/projectkorra/ProjectKorra/waterbending/IceSpike.java @@ -117,7 +117,7 @@ public class IceSpike { public IceSpike(Player player, Location origin, int damage, Vector throwing, long aoecooldown) { - this.cooldown = aoecooldown; + cooldown = aoecooldown; this.player = player; this.origin = origin; location = origin.clone();