Fixed Disabled Abilities Loading

• 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
This commit is contained in:
StrangeOne101 2016-06-12 16:47:00 +12:00
parent 6419ba6201
commit 4cad1dd5c3
6 changed files with 6 additions and 6 deletions

View file

@ -248,7 +248,7 @@ public class BendingPlayer {
} }
public boolean canBind(CoreAbility ability) { public boolean canBind(CoreAbility ability) {
if (ability == null || !player.isOnline()) { if (ability == null || !player.isOnline() || !ability.isEnabled()) {
return false; return false;
} else if (!player.hasPermission("bending.ability." + ability.getName())) { } else if (!player.hasPermission("bending.ability." + ability.getName())) {
return false; return false;

View file

@ -384,7 +384,7 @@ public class GeneralMethods {
for (int i = 1; i <= 9; i++) { for (int i = 1; i <= 9; i++) {
String slot = rs2.getString("slot" + 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); abilities.put(i, slot);
} }
} }

View file

@ -517,7 +517,7 @@ public abstract class CoreAbility implements Ability {
String tag = null; String tag = null;
if (this instanceof ComboAbility) { if (this instanceof ComboAbility) {
tag = "Abilities." + elementName + "." + elementName + "Combo" + ".Enabled"; tag = "Abilities." + elementName + "." + elementName + "Combo." + getName() + ".Enabled";
} else { } else {
tag = "Abilities." + elementName + "." + getName() + ".Enabled"; tag = "Abilities." + elementName + "." + getName() + ".Enabled";
} }

View file

@ -40,7 +40,7 @@ public class BindCommand extends PKCommand {
} }
CoreAbility coreAbil = CoreAbility.getAbility(args.get(0)); CoreAbility coreAbil = CoreAbility.getAbility(args.get(0));
if (coreAbil == null || coreAbil.isHiddenAbility()) { if (coreAbil == null || coreAbil.isHiddenAbility() || !coreAbil.isEnabled()) {
sender.sendMessage(ChatColor.RED + abilityDoesntExist); sender.sendMessage(ChatColor.RED + abilityDoesntExist);
return; return;
} }

View file

@ -33,7 +33,7 @@ public class FireBlast extends FireAbility {
private boolean powerFurnace; private boolean powerFurnace;
private boolean showParticles; private boolean showParticles;
private boolean dissipate; private boolean dissipate;
private boolean isFireBurst; private boolean isFireBurst = false;
private int ticks; private int ticks;
private long cooldown; private long cooldown;
private double speedFactor; private double speedFactor;

View file

@ -473,7 +473,7 @@ public class Torrent extends WaterAbility {
Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock(); Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock();
if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) { if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) {
block.setType(Material.WATER); block.setType(Material.WATER);
block.setData((byte) 0); block.setData((byte) 8);
Torrent tor = new Torrent(player); Torrent tor = new Torrent(player);
if (tor.sourceSelected || tor.settingUp) { if (tor.sourceSelected || tor.settingUp) {