Fix help command

Stop help command from showing players commands they dont have
permissions to use
This commit is contained in:
jedk1 2016-01-10 21:19:34 +00:00
parent 3c893bbb8d
commit 111ecd8f66

View file

@ -32,7 +32,7 @@ public class HelpCommand extends PKCommand {
else if (args.size() == 0) {
List<String> strings = new ArrayList<String>();
for (PKCommand command : instances.values()) {
if (!command.getName().equalsIgnoreCase("help")) {
if (!command.getName().equalsIgnoreCase("help") && sender.hasPermission("bending.command." + command.getName())) {
strings.add(command.getProperUse());
}
}
@ -51,7 +51,7 @@ public class HelpCommand extends PKCommand {
if (isNumeric(arg)) {
List<String> strings = new ArrayList<String>();
for (PKCommand command : instances.values()) {
if (!command.getName().equalsIgnoreCase("help")) {
if (!command.getName().equalsIgnoreCase("help") && sender.hasPermission("bending.command." + command.getName())) {
strings.add(command.getProperUse());
}
}