Archiviert
1
0

Update ArenaCommand

Dieser Commit ist enthalten in:
yoyosource 2022-07-18 16:19:48 +02:00
Ursprung 183248c0b1
Commit 8bcefb102c

Datei anzeigen

@ -30,6 +30,7 @@ import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class ArenaCommand extends SWCommand { public class ArenaCommand extends SWCommand {
@ -62,10 +63,10 @@ public class ArenaCommand extends SWCommand {
@Override @Override
public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) { public Collection<String> tabCompletes(CommandSender sender, String[] previousArguments, String s) {
return ProxyServer.getInstance().getServersCopy().values().stream().filter(server -> { List<Subserver> subserverList = Subserver.getServerList();
Subserver subserver = Subserver.getSubserver(server); synchronized (subserverList) {
return subserver != null && subserver.getType() == Servertype.ARENA; return subserverList.stream().filter(subserver -> subserver.getType() == Servertype.ARENA).map(subserver -> subserver.getServer().getName()).collect(Collectors.toList());
}).map(ServerInfo::getName).collect(Collectors.toList()); }
} }
}; };
} }