Archiviert
1
0

Hotfix TypeMappers

Dieser Commit ist enthalten in:
yoyosource 2022-09-06 16:45:56 +02:00
Ursprung baef387fdb
Commit 2676f97cfb
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen

@ -1 +1 @@
Subproject commit 6e6d34905ac39bd2ed9548729041febadd42da2f Subproject commit 9df92595b2f344585bd3e1639cedc761680b7761

Datei anzeigen

@ -77,6 +77,7 @@ public class TypeMappers {
return new TypeMapper<String>() { return new TypeMapper<String>() {
@Override @Override
public String map(CommandSender commandSender, String[] previousArguments, String s) { public String map(CommandSender commandSender, String[] previousArguments, String s) {
if (previousArguments.length == 0) return null;
if (s.equalsIgnoreCase("random")) return "random"; if (s.equalsIgnoreCase("random")) return "random";
ArenaMode arenaMode = ArenaMode.getByChat(previousArguments[previousArguments.length - 1]); ArenaMode arenaMode = ArenaMode.getByChat(previousArguments[previousArguments.length - 1]);
if (arenaMode.getMaps().contains(s)) return s; if (arenaMode.getMaps().contains(s)) return s;
@ -85,6 +86,7 @@ public class TypeMappers {
@Override @Override
public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) { public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) {
if (previousArguments.length == 0) return null;
ArenaMode arenaMode = ArenaMode.getByChat(previousArguments[previousArguments.length - 1]); ArenaMode arenaMode = ArenaMode.getByChat(previousArguments[previousArguments.length - 1]);
List<String> stringList = new ArrayList<>(arenaMode.getMaps()); List<String> stringList = new ArrayList<>(arenaMode.getMaps());
stringList.add("random"); stringList.add("random");