Optimize SWCommand
Dieser Commit ist enthalten in:
Ursprung
ee9f9d40ce
Commit
37d308346e
@ -47,14 +47,8 @@ public abstract class SWCommand {
|
||||
this.command = new Command(command, "", "/" + command, Arrays.asList(aliases)) {
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String alias, String[] args) {
|
||||
// if (commandList.stream().filter(s -> s.invoke(sender, args)).findFirst().isPresent()) return false;
|
||||
// if (commandHelpList.stream().filter(s -> s.invoke(sender, args)).findFirst().isPresent()) return false;
|
||||
for (SubCommand subCommand : commandList) {
|
||||
if (subCommand.invoke(sender, args)) return false;
|
||||
}
|
||||
for (SubCommand subCommand : commandHelpList) {
|
||||
if (subCommand.invoke(sender, args)) return false;
|
||||
}
|
||||
if (commandList.stream().anyMatch(s -> s.invoke(sender, args))) return false;
|
||||
commandHelpList.stream().anyMatch(s -> s.invoke(sender, args));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren