diff --git a/build.gradle b/build.gradle index 41561b1..16f5a3f 100644 --- a/build.gradle +++ b/build.gradle @@ -4,8 +4,9 @@ plugins { } group 'com.danifoldi' -version '1.2.5' +version '1.2.6' sourceCompatibility = JavaVersion.VERSION_11 +targetCompatibility = JavaVersion.VERSION_11 repositories { mavenCentral() diff --git a/src/main/java/com/danifoldi/bungeegui/command/PluginCommand.java b/src/main/java/com/danifoldi/bungeegui/command/PluginCommand.java index 86968cc..acdc7fd 100644 --- a/src/main/java/com/danifoldi/bungeegui/command/PluginCommand.java +++ b/src/main/java/com/danifoldi/bungeegui/command/PluginCommand.java @@ -289,7 +289,7 @@ public void execute(final @NotNull CommandSender sender, final @NotNull String[] case "p": return List.of(ProxyServer.getInstance().getPlayer(target.getSecond())); case "s": - return ProxyServer.getInstance().getServersCopy().get(target.getSecond()).getPlayers(); + return ProxyServer.getInstance().getServers().get(target.getSecond()).getPlayers(); default: return Collections.emptyList(); } diff --git a/src/main/java/com/danifoldi/bungeegui/inject/BungeeGuiComponent.java b/src/main/java/com/danifoldi/bungeegui/inject/BungeeGuiComponent.java index 6ff7d2a..33a6297 100644 --- a/src/main/java/com/danifoldi/bungeegui/inject/BungeeGuiComponent.java +++ b/src/main/java/com/danifoldi/bungeegui/inject/BungeeGuiComponent.java @@ -7,7 +7,6 @@ import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.plugin.PluginManager; import net.md_5.bungee.api.scheduler.TaskScheduler; -import org.intellij.lang.annotations.MagicConstant; import org.jetbrains.annotations.NotNull; import javax.inject.Singleton; diff --git a/src/main/java/com/danifoldi/bungeegui/main/GuiHandler.java b/src/main/java/com/danifoldi/bungeegui/main/GuiHandler.java index 05fb9cb..b417e25 100644 --- a/src/main/java/com/danifoldi/bungeegui/main/GuiHandler.java +++ b/src/main/java/com/danifoldi/bungeegui/main/GuiHandler.java @@ -11,7 +11,6 @@ import com.danifoldi.bungeegui.util.StringUtil; import com.electronwill.nightconfig.core.Config; import com.electronwill.nightconfig.core.EnumGetMethod; -import dagger.Module; import de.exceptionflug.protocolize.inventory.Inventory; import de.exceptionflug.protocolize.inventory.InventoryModule; import de.exceptionflug.protocolize.items.ItemStack; diff --git a/src/main/java/com/danifoldi/bungeegui/main/PlaceholderHandler.java b/src/main/java/com/danifoldi/bungeegui/main/PlaceholderHandler.java index aa8575b..af2978d 100644 --- a/src/main/java/com/danifoldi/bungeegui/main/PlaceholderHandler.java +++ b/src/main/java/com/danifoldi/bungeegui/main/PlaceholderHandler.java @@ -107,7 +107,7 @@ void unregisterAll() { void registerBuiltins() { final @NotNull ConcurrentMap lastStatus = new ConcurrentHashMap<>(); refreshData = proxyServer.getScheduler().schedule(plugin, () -> { - for (ServerInfo server: proxyServer.getServersCopy().values()) { + for (ServerInfo server: Map.copyOf(proxyServer.getServers()).values()) { server.ping((ping, error) -> { if (lastStatus.containsKey(server) && lastStatus.get(server) != (error == null)) { if (error != null) { @@ -149,7 +149,7 @@ void registerBuiltins() { return String.valueOf(count); }); registerBuiltin("guicount", player -> String.valueOf(BungeeGuiAPI.getInstance().getAvailableGuis().size())); - registerBuiltin("servercount", player -> String.valueOf(proxyServer.getServersCopy().size())); + registerBuiltin("servercount", player -> String.valueOf(proxyServer.getServers().size())); registerBuiltin("plugincount", player -> String.valueOf(pluginManager.getPlugins().size())); registerBuiltin("placeholdercount", player -> String.valueOf(placeholders.size() + builtinPlaceholders.size())); registerBuiltin("displayname", player -> { @@ -318,7 +318,7 @@ void registerBuiltins() { } }); - for (Map.Entry server: proxyServer.getServersCopy().entrySet()) { + for (Map.Entry server: Map.copyOf(proxyServer.getServers()).entrySet()) { registerBuiltin("status@" + server.getKey(), player -> { final boolean online = lastStatus.get(server.getValue()); return online ? "Online" : "Offline";