Code cleanup

maybe a bug fix or two
This commit is contained in:
MattBDev
2016-03-28 17:31:40 -04:00
parent 8d4f042abc
commit 76e2b1f416
18 changed files with 99 additions and 97 deletions

View File

@@ -473,7 +473,11 @@ public abstract class Command {
String arg = args[0].toLowerCase();
if (space) {
Command cmd = getCommand(arg);
return (cmd != null && cmd.canExecute(player, false)) ? cmd.tab(player, Arrays.copyOfRange(args, 1, args.length), space) : null;
if (cmd != null && cmd.canExecute(player, false)) {
return cmd.tab(player, Arrays.copyOfRange(args, 1, args.length), space);
} else {
return null;
}
} else {
Set<Command> commands = new HashSet<Command>();
for (Map.Entry<String, Command> entry : this.staticCommands.entrySet()) {
@@ -485,7 +489,11 @@ public abstract class Command {
}
default:
Command cmd = getCommand(args[0]);
return cmd != null ? cmd.tab(player, Arrays.copyOfRange(args, 1, args.length), space) : null;
if (cmd != null) {
return cmd.tab(player, Arrays.copyOfRange(args, 1, args.length), space);
} else {
return null;
}
}
}