Archiviert
1
0

Hotfix TypeMappers

Dieser Commit ist enthalten in:
yoyosource 2022-09-24 11:15:40 +02:00
Ursprung 5bfb2d5c71
Commit 0296716a4e
2 geänderte Dateien mit 13 neuen und 8 gelöschten Zeilen
CommonCore
src/de/steamwar/bungeecore/commands

@ -1 +1 @@
Subproject commit 1dea71993d897354d3f52a705f6e0e1e0c8ec580
Subproject commit a249d66dcf96bb9aef44b700438c81670ad81de7

Datei anzeigen

@ -33,6 +33,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
@UtilityClass
public class TypeMappers {
@ -66,15 +67,19 @@ public class TypeMappers {
return ArenaMode.getByChat(s);
}
@Override
public boolean validate(CommandSender sender, ArenaMode value, MessageSender messageSender) {
if (value == null) return true;
return value.isHistoric() == historic;
}
@Override
public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) {
return ArenaMode.getAllChatNames(historic);
if (!historic) {
List<String> toReturn = ArenaMode.getAllChatNames(false).stream()
.map(String::toLowerCase)
.filter(s1 -> s1.startsWith(s.toLowerCase()))
.collect(Collectors.toList());
if (toReturn.isEmpty()) {
return ArenaMode.getAllChatNames(true);
}
return toReturn;
}
return ArenaMode.getAllChatNames(true);
}
};
}