From 5ecbd4b2bc82f83674b4b265ffa7fa9ee2451783 Mon Sep 17 00:00:00 2001 From: Ranzdo Date: Wed, 7 Nov 2012 05:51:32 +0100 Subject: [PATCH] Fix to issue #28 and also added a default case to tab list. --- src/main/java/net/md_5/bungee/BungeeCord.java | 2 +- .../bungee/tablist/ServerUnqiueTabList.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/md_5/bungee/BungeeCord.java b/src/main/java/net/md_5/bungee/BungeeCord.java index 917b3156..11ae5182 100644 --- a/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/src/main/java/net/md_5/bungee/BungeeCord.java @@ -165,7 +165,7 @@ public class BungeeCord switch (config.tabList) { - case 1: + default: case 1: tabListHandler = new GlobalPingTabList(); break; case 2: diff --git a/src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java b/src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java index 86ba66d8..2b73eef8 100644 --- a/src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java +++ b/src/main/java/net/md_5/bungee/tablist/ServerUnqiueTabList.java @@ -24,16 +24,16 @@ public class ServerUnqiueTabList implements TabListHandler public void onServerChange(UserConnection con) { Set usernames = sentUsernames.get(con); - synchronized (usernames) + if (usernames != null) { - if (usernames != null) - { - 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(); + } } }