Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
remove waterfall-only method
Browse files Browse the repository at this point in the history
fixes #75
  • Loading branch information
DaniFoldi committed Jun 17, 2021
1 parent 3c57554 commit 0ba47b8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/danifoldi/bungeegui/main/GuiHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void unregisterAll() {
void registerBuiltins() {
final @NotNull ConcurrentMap<ServerInfo, Boolean> 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) {
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -318,7 +318,7 @@ void registerBuiltins() {
}
});

for (Map.Entry<String, ServerInfo> server: proxyServer.getServersCopy().entrySet()) {
for (Map.Entry<String, ServerInfo> server: Map.copyOf(proxyServer.getServers()).entrySet()) {
registerBuiltin("status@" + server.getKey(), player -> {
final boolean online = lastStatus.get(server.getValue());
return online ? "Online" : "Offline";
Expand Down

0 comments on commit 0ba47b8

Please sign in to comment.