From 36f5f33db0ae472533dbdd56a240ae8adac73c68 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 2 Feb 2013 09:11:26 +1100 Subject: [PATCH] Forward even when no players are online. --- .../src/main/java/net/md_5/bungee/UserConnection.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 8b5173a4..beb1f9d9 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -404,14 +404,13 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer if (target.equals("ALL")) { - for (String s : BungeeCord.getInstance().getServers().keySet()) + for (ServerInfo server : BungeeCord.getInstance().getServers().values()) { - Server server = BungeeCord.getInstance().getServer(s); server.sendData("BungeeCord", b.toByteArray()); } } else { - Server server = BungeeCord.getInstance().getServer(target); + ServerInfo server = BungeeCord.getInstance().getServerInfo(target); if (server != null) { server.sendData("BungeeCord", b.toByteArray()); @@ -420,7 +419,7 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer } if (subChannel.equals("Connect")) { - ServerInfo server = BungeeCord.getInstance().config.getServers().get(in.readUTF()); + ServerInfo server = ProxyServer.getInstance().getServerInfo(in.readUTF()); if (server != null) { connect(server); @@ -438,7 +437,7 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer } if (subChannel.equals("PlayerCount")) { - ServerInfo server = BungeeCord.getInstance().config.getServers().get(in.readUTF()); + ServerInfo server = ProxyServer.getInstance().getServerInfo(in.readUTF()); if (server != null) { ByteArrayOutputStream b = new ByteArrayOutputStream(); @@ -451,7 +450,7 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer } if (subChannel.equals("PlayerList")) { - ServerInfo server = BungeeCord.getInstance().config.getServers().get(in.readUTF()); + ServerInfo server = ProxyServer.getInstance().getServerInfo(in.readUTF()); if (server != null) { ByteArrayOutputStream b = new ByteArrayOutputStream();