From 4cad1dd5c3598644557a9ae0bb1a38fc6b30116c Mon Sep 17 00:00:00 2001 From: StrangeOne101 Date: Sun, 12 Jun 2016 16:47:00 +1200 Subject: [PATCH] Fixed Disabled Abilities Loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixes disabled abilities still being able to be bound (some) and used • Fixes Torrent flood issue with bottlebending • Fixed Combos not being able to be disabled --- src/com/projectkorra/projectkorra/BendingPlayer.java | 2 +- src/com/projectkorra/projectkorra/GeneralMethods.java | 2 +- src/com/projectkorra/projectkorra/ability/CoreAbility.java | 2 +- src/com/projectkorra/projectkorra/command/BindCommand.java | 2 +- src/com/projectkorra/projectkorra/firebending/FireBlast.java | 2 +- src/com/projectkorra/projectkorra/waterbending/Torrent.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/projectkorra/projectkorra/BendingPlayer.java b/src/com/projectkorra/projectkorra/BendingPlayer.java index 16dfee9f..30cc1082 100644 --- a/src/com/projectkorra/projectkorra/BendingPlayer.java +++ b/src/com/projectkorra/projectkorra/BendingPlayer.java @@ -248,7 +248,7 @@ public class BendingPlayer { } public boolean canBind(CoreAbility ability) { - if (ability == null || !player.isOnline()) { + if (ability == null || !player.isOnline() || !ability.isEnabled()) { return false; } else if (!player.hasPermission("bending.ability." + ability.getName())) { return false; diff --git a/src/com/projectkorra/projectkorra/GeneralMethods.java b/src/com/projectkorra/projectkorra/GeneralMethods.java index 3ebe9bc2..9d099aaf 100644 --- a/src/com/projectkorra/projectkorra/GeneralMethods.java +++ b/src/com/projectkorra/projectkorra/GeneralMethods.java @@ -384,7 +384,7 @@ public class GeneralMethods { for (int i = 1; i <= 9; i++) { String slot = rs2.getString("slot" + i); - if (slot != null && !slot.equalsIgnoreCase("null")) { + if (slot != null && !slot.equalsIgnoreCase("null") && CoreAbility.getAbility(slot) != null && CoreAbility.getAbility(slot).isEnabled()) { abilities.put(i, slot); } } diff --git a/src/com/projectkorra/projectkorra/ability/CoreAbility.java b/src/com/projectkorra/projectkorra/ability/CoreAbility.java index ece49fe1..57d70bf8 100644 --- a/src/com/projectkorra/projectkorra/ability/CoreAbility.java +++ b/src/com/projectkorra/projectkorra/ability/CoreAbility.java @@ -517,7 +517,7 @@ public abstract class CoreAbility implements Ability { String tag = null; if (this instanceof ComboAbility) { - tag = "Abilities." + elementName + "." + elementName + "Combo" + ".Enabled"; + tag = "Abilities." + elementName + "." + elementName + "Combo." + getName() + ".Enabled"; } else { tag = "Abilities." + elementName + "." + getName() + ".Enabled"; } diff --git a/src/com/projectkorra/projectkorra/command/BindCommand.java b/src/com/projectkorra/projectkorra/command/BindCommand.java index 2db85145..a1928caf 100644 --- a/src/com/projectkorra/projectkorra/command/BindCommand.java +++ b/src/com/projectkorra/projectkorra/command/BindCommand.java @@ -40,7 +40,7 @@ public class BindCommand extends PKCommand { } CoreAbility coreAbil = CoreAbility.getAbility(args.get(0)); - if (coreAbil == null || coreAbil.isHiddenAbility()) { + if (coreAbil == null || coreAbil.isHiddenAbility() || !coreAbil.isEnabled()) { sender.sendMessage(ChatColor.RED + abilityDoesntExist); return; } diff --git a/src/com/projectkorra/projectkorra/firebending/FireBlast.java b/src/com/projectkorra/projectkorra/firebending/FireBlast.java index 8b8e8bcb..a41ecb1b 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBlast.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBlast.java @@ -33,7 +33,7 @@ public class FireBlast extends FireAbility { private boolean powerFurnace; private boolean showParticles; private boolean dissipate; - private boolean isFireBurst; + private boolean isFireBurst = false; private int ticks; private long cooldown; private double speedFactor; diff --git a/src/com/projectkorra/projectkorra/waterbending/Torrent.java b/src/com/projectkorra/projectkorra/waterbending/Torrent.java index b62a94f6..09668dbc 100644 --- a/src/com/projectkorra/projectkorra/waterbending/Torrent.java +++ b/src/com/projectkorra/projectkorra/waterbending/Torrent.java @@ -473,7 +473,7 @@ public class Torrent extends WaterAbility { Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock(); if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) { block.setType(Material.WATER); - block.setData((byte) 0); + block.setData((byte) 8); Torrent tor = new Torrent(player); if (tor.sourceSelected || tor.settingUp) {