/b display wont show abilities player cant use

This one actually does it
This commit is contained in:
MistPhizzle 2014-06-30 20:48:07 -04:00
parent 86707725b8
commit 9bd3772148
2 changed files with 10 additions and 5 deletions

View file

@ -215,7 +215,7 @@ public class Commands {
return true;
}
for (String st: AbilityModuleManager.airbendingabilities) {
if (Methods.canBend(s.getName(), st)) {
if (Methods.hasPermission((Player) s, st)) {
s.sendMessage(Methods.getAirColor() + st);
}
}
@ -227,7 +227,7 @@ public class Commands {
return true;
}
for (String st: AbilityModuleManager.waterbendingabilities) {
if (Methods.canBend(s.getName(), st)) {
if (Methods.hasPermission((Player) s, st)) {
s.sendMessage(Methods.getWaterColor() + st);
}
}
@ -239,7 +239,7 @@ public class Commands {
return true;
}
for (String st: AbilityModuleManager.earthbendingabilities) {
if (Methods.canBend(s.getName(), st)) {
if (Methods.hasPermission((Player) s, st)) {
s.sendMessage(Methods.getEarthColor() + st);
}
}
@ -251,7 +251,7 @@ public class Commands {
return true;
}
for (String st: AbilityModuleManager.firebendingabilities) {
if (Methods.canBend(s.getName(), st)) {
if (Methods.hasPermission((Player) s, st)) {
s.sendMessage(Methods.getFireColor() + st);
}
}
@ -264,7 +264,7 @@ public class Commands {
}
for (String st: AbilityModuleManager.chiabilities) {
if (Methods.canBend(s.getName(), st)) {
if (Methods.hasPermission((Player) s, st)) {
s.sendMessage(Methods.getChiColor() + st);
}
}

View file

@ -446,6 +446,11 @@ public class Methods {
}
}
public static boolean hasPermission(Player player, String ability) {
if (player.hasPermission("bending.ability." + ability)) return true;
return false;
}
public static boolean canBendPassive(String player, Element element) {
BendingPlayer bPlayer = getBendingPlayer(player);