mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Fixes
Fixes Waterwave crash Fixes Debug permission message Fixes Bind toggling message Fixes BendingPlayer isElementToggled NPE
This commit is contained in:
parent
6975513d7f
commit
0fae906385
4 changed files with 10 additions and 9 deletions
|
@ -203,7 +203,9 @@ public class BendingPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isElementToggled(Element e) {
|
public boolean isElementToggled(Element e) {
|
||||||
return this.toggledElements.get(e);
|
if(e != null)
|
||||||
|
return this.toggledElements.get(e);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,10 +28,6 @@ public class BindCommand extends PKCommand {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GeneralMethods.getBendingPlayer(sender.getName()).isElementToggled(GeneralMethods.getAbilityElement(args.get(0))) == false) {
|
|
||||||
sender.sendMessage(ChatColor.RED + "You have that ability's element toggled off currently.");
|
|
||||||
}
|
|
||||||
|
|
||||||
String ability = GeneralMethods.getAbility(args.get(0));
|
String ability = GeneralMethods.getAbility(args.get(0));
|
||||||
// bending bind [Ability]
|
// bending bind [Ability]
|
||||||
if (args.size() == 1) {
|
if (args.size() == 1) {
|
||||||
|
@ -53,7 +49,10 @@ public class BindCommand extends PKCommand {
|
||||||
if (!GeneralMethods.canBind(((Player) sender).getName(), ability)) {
|
if (!GeneralMethods.canBind(((Player) sender).getName(), ability)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You don't have permission to bend this element.");
|
sender.sendMessage(ChatColor.RED + "You don't have permission to bend this element.");
|
||||||
return;
|
return;
|
||||||
|
} else if (!GeneralMethods.getBendingPlayer(sender.getName()).isElementToggled(GeneralMethods.getAbilityElement(ability))) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "You have that ability's element toggled off currently.");
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralMethods.bindAbility((Player) sender, GeneralMethods.getAbility(ability), slot);
|
GeneralMethods.bindAbility((Player) sender, GeneralMethods.getAbility(ability), slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,10 +38,10 @@ public class DebugCommand extends PKCommand {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(CommandSender sender) {
|
public boolean hasPermission(CommandSender sender) {
|
||||||
if (sender.hasPermission("bending.admin." + getName())) {
|
if (!sender.hasPermission("bending.admin." + getName())) {
|
||||||
sender.sendMessage(ChatColor.RED + "You don't have permission to use this command.");
|
sender.sendMessage(ChatColor.RED + "You don't have permission to use this command.");
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class WaterWave {
|
||||||
|
|
||||||
public void progress() {
|
public void progress() {
|
||||||
progressCounter++;
|
progressCounter++;
|
||||||
if (player.isDead() || !player.isOnline() || !origin.getWorld().equals(player.getWorld())) {
|
if (player.isDead() || !player.isOnline()) {
|
||||||
remove();
|
remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue