From a20e8951f6b6d170fe1e6ec5159fd22ce071ccd5 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 8 Nov 2012 18:55:32 +1100 Subject: [PATCH] Clean some formatting etc --- src/main/java/net/md_5/bungee/BungeeCord.java | 7 ++++--- .../java/net/md_5/bungee/Configuration.java | 6 +++--- .../bungee/tablist/GlobalPingTabList.java | 3 +-- .../md_5/bungee/tablist/GlobalTabList.java | 4 ++-- ...eTabList.java => ServerUniqueTabList.java} | 21 +++++++++---------- 5 files changed, 20 insertions(+), 21 deletions(-) rename src/main/java/net/md_5/bungee/tablist/{ServerUnqiueTabList.java => ServerUniqueTabList.java} (71%) diff --git a/src/main/java/net/md_5/bungee/BungeeCord.java b/src/main/java/net/md_5/bungee/BungeeCord.java index 11ae51820..a3ba5d727 100644 --- a/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/src/main/java/net/md_5/bungee/BungeeCord.java @@ -26,7 +26,7 @@ import net.md_5.bungee.packet.DefinedPacket; import net.md_5.bungee.plugin.JavaPluginManager; import net.md_5.bungee.tablist.GlobalPingTabList; import net.md_5.bungee.tablist.GlobalTabList; -import net.md_5.bungee.tablist.ServerUnqiueTabList; +import net.md_5.bungee.tablist.ServerUniqueTabList; import net.md_5.bungee.tablist.TabListHandler; /** @@ -165,14 +165,15 @@ public class BungeeCord switch (config.tabList) { - default: case 1: + default: + case 1: tabListHandler = new GlobalPingTabList(); break; case 2: tabListHandler = new GlobalTabList(); break; case 3: - tabListHandler = new ServerUnqiueTabList(); + tabListHandler = new ServerUniqueTabList(); break; } diff --git a/src/main/java/net/md_5/bungee/Configuration.java b/src/main/java/net/md_5/bungee/Configuration.java index 7f1bf1c47..2e486f42b 100644 --- a/src/main/java/net/md_5/bungee/Configuration.java +++ b/src/main/java/net/md_5/bungee/Configuration.java @@ -72,9 +72,9 @@ public class Configuration public int maxPlayers = 1; /** * Tab list 1: For a tab list that is global over all server (using their - * minecraft name) and updating their ping frequently 2: Same as 1 but does - * not update their ping frequently, just once. 3: Makes the individual - * servers handle the tab list (server unique) + * Minecraft name) and updating their ping frequently 2: Same as 1 but does + * not update their ping frequently, just once, 3: Makes the individual + * servers handle the tab list (server unique). */ public int tabList = 1; /** diff --git a/src/main/java/net/md_5/bungee/tablist/GlobalPingTabList.java b/src/main/java/net/md_5/bungee/tablist/GlobalPingTabList.java index e6ac5ec5a..8696da461 100644 --- a/src/main/java/net/md_5/bungee/tablist/GlobalPingTabList.java +++ b/src/main/java/net/md_5/bungee/tablist/GlobalPingTabList.java @@ -12,8 +12,7 @@ public class GlobalPingTabList extends GlobalTabList { public static final int PING_THRESHOLD = 20; - private Map lastPings = - Collections.synchronizedMap(new WeakHashMap()); + private Map lastPings = Collections.synchronizedMap(new WeakHashMap()); @Override public void onPingChange(final UserConnection con, final int ping) diff --git a/src/main/java/net/md_5/bungee/tablist/GlobalTabList.java b/src/main/java/net/md_5/bungee/tablist/GlobalTabList.java index 524db3aaa..45062f41c 100644 --- a/src/main/java/net/md_5/bungee/tablist/GlobalTabList.java +++ b/src/main/java/net/md_5/bungee/tablist/GlobalTabList.java @@ -16,9 +16,9 @@ public class GlobalTabList implements TabListHandler @Override public void onJoin(UserConnection con) { - for (UserConnection con2 : BungeeCord.instance.connections.values()) + for (UserConnection c : BungeeCord.instance.connections.values()) { - con.packetQueue.add(new PacketC9PlayerListItem(con2.username, true, con2.getPing())); + con.packetQueue.add(new PacketC9PlayerListItem(c.username, true, c.getPing())); } } diff --git a/src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java b/src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java similarity index 71% rename from src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java rename to src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java index 2b73eef85..48c747fef 100644 --- a/src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java +++ b/src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java @@ -9,11 +9,10 @@ import java.util.WeakHashMap; import net.md_5.bungee.UserConnection; import net.md_5.bungee.packet.PacketC9PlayerListItem; -public class ServerUnqiueTabList implements TabListHandler +public class ServerUniqueTabList implements TabListHandler { - private Map> sentUsernames = - Collections.synchronizedMap(new WeakHashMap>()); + private Map> sentUsernames = Collections.synchronizedMap(new WeakHashMap>()); @Override public void onJoin(UserConnection con) @@ -26,14 +25,14 @@ public class ServerUnqiueTabList implements TabListHandler Set usernames = sentUsernames.get(con); if (usernames != null) { - synchronized (usernames) - { - for (String username : usernames) - { - con.packetQueue.add(new PacketC9PlayerListItem(username, false, 9999)); - } - usernames.clear(); - } + synchronized (usernames) + { + for (String username : usernames) + { + con.packetQueue.add(new PacketC9PlayerListItem(username, false, 9999)); + } + usernames.clear(); + } } }