SteamWar/SpigotCore
Archiviert
13
0

Add SWCommand.Register.Registeres #104

Manuell gemergt
Lixfel hat 19 Commits von Registeres nach master 2021-05-12 20:35:45 +02:00 zusammengeführt
Nur Änderungen aus Commit 06fb4bbc1a werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -60,12 +60,10 @@ public abstract class SWCommand {
@Override
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
List<String> strings = new ArrayList<>();
for (SubCommand subCommand : commandList) {
List<String> tabCompletes = subCommand.tabComplete(sender, args);
if (tabCompletes != null) strings.addAll(tabCompletes);
}
return strings.stream()
return commandList.stream()
.map(s -> s.tabComplete(sender, args))
.filter(Objects::nonNull)
.flatMap(Collection::stream)
.filter(s -> !s.isEmpty())
.filter(s -> !s.isBlank())
.filter(s -> s.toLowerCase().startsWith(args[args.length - 1].toLowerCase()))