SteamWar/BungeeCore
Archiviert
13
2

Hotfix TypeMappers
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

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

@ -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.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@UtilityClass @UtilityClass
public class TypeMappers { public class TypeMappers {
@ -66,15 +67,19 @@ public class TypeMappers {
return ArenaMode.getByChat(s); return ArenaMode.getByChat(s);
} }
@Override
public boolean validate(CommandSender sender, ArenaMode value, MessageSender messageSender) {
if (value == null) return true;
return value.isHistoric() == historic;
}
@Override @Override
public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) { 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);
} }
}; };
} }