From 8bcefb102c8f17cebb46ad3930d1d8aaf4799654 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 18 Jul 2022 16:19:48 +0200 Subject: [PATCH] Update ArenaCommand --- src/de/steamwar/bungeecore/commands/ArenaCommand.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/ArenaCommand.java b/src/de/steamwar/bungeecore/commands/ArenaCommand.java index b73d6d29..83558aed 100644 --- a/src/de/steamwar/bungeecore/commands/ArenaCommand.java +++ b/src/de/steamwar/bungeecore/commands/ArenaCommand.java @@ -30,6 +30,7 @@ import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; import java.util.Collection; +import java.util.List; import java.util.stream.Collectors; public class ArenaCommand extends SWCommand { @@ -62,10 +63,10 @@ public class ArenaCommand extends SWCommand { @Override public Collection tabCompletes(CommandSender sender, String[] previousArguments, String s) { - return ProxyServer.getInstance().getServersCopy().values().stream().filter(server -> { - Subserver subserver = Subserver.getSubserver(server); - return subserver != null && subserver.getType() == Servertype.ARENA; - }).map(ServerInfo::getName).collect(Collectors.toList()); + List subserverList = Subserver.getServerList(); + synchronized (subserverList) { + return subserverList.stream().filter(subserver -> subserver.getType() == Servertype.ARENA).map(subserver -> subserver.getServer().getName()).collect(Collectors.toList()); + } } }; }