SteamWar/SpigotCore
Archiviert
13
0

Optimize SWCommand

Dieser Commit ist enthalten in:
yoyosource 2021-05-05 10:02:07 +02:00
Ursprung ee9f9d40ce
Commit 37d308346e

Datei anzeigen

@ -47,14 +47,8 @@ public abstract class SWCommand {
this.command = new Command(command, "", "/" + command, Arrays.asList(aliases)) { this.command = new Command(command, "", "/" + command, Arrays.asList(aliases)) {
@Override @Override
public boolean execute(CommandSender sender, String alias, String[] args) { public boolean execute(CommandSender sender, String alias, String[] args) {
// if (commandList.stream().filter(s -> s.invoke(sender, args)).findFirst().isPresent()) return false; if (commandList.stream().anyMatch(s -> s.invoke(sender, args))) return false;
// if (commandHelpList.stream().filter(s -> s.invoke(sender, args)).findFirst().isPresent()) return false; commandHelpList.stream().anyMatch(s -> s.invoke(sender, args));
for (SubCommand subCommand : commandList) {
if (subCommand.invoke(sender, args)) return false;
}
for (SubCommand subCommand : commandHelpList) {
if (subCommand.invoke(sender, args)) return false;
}
return false; return false;
} }