diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index e2c11d1c5..a2d6c28f6 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -589,9 +589,9 @@ public class ServerManager extends MiniPlugin if (serverList == null) return null; List servers = new ArrayList(serverList); - Collections.sort(servers, new ServerCountSorter()); servers = fetchOpenServers(player, servers, servers.size()); // Removes all full servers from list - + Collections.sort(servers, new ServerCountSorter()); + int count = Math.min(servers.size(), TOP_SERVERS); if (count > 0) @@ -600,10 +600,12 @@ public class ServerManager extends MiniPlugin if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED || largestServer.MaxPlayers > 40) { + System.out.println("Largest."); return largestServer; } else { + System.out.println("Random."); return servers.get(random.nextInt(count)); } } @@ -689,13 +691,9 @@ public class ServerManager extends MiniPlugin for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null)) { addServerGroup(serverGroup); - System.out.println("Adding servergroup : " + serverGroup.getName() + " prefix:" + serverGroup.getPrefix()); - + if (!serverGroup.getServerNpcName().isEmpty()) - { AddServerNpc(serverGroup); - System.out.println("Adding to npcs"); - } if (!serverGroup.getPortalBottomCornerLocation().isEmpty() && !serverGroup.getPortalTopCornerLocation().isEmpty()) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java index 91065658c..6587030d7 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerCountSorter.java @@ -8,6 +8,6 @@ public class ServerCountSorter implements Comparator { public int compare(ServerInfo a, ServerInfo b) { - return a.CurrentPlayers - b.CurrentPlayers; + return b.CurrentPlayers - a.CurrentPlayers; } } \ No newline at end of file diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java index fe38ea991..0eb38f09e 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcPage.java @@ -52,23 +52,6 @@ public class ServerNpcPage extends ShopPageBase im @Override protected void buildPage() { - /* - setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Solo " + C.cGray + getName(), new String[] - { - ChatColor.RESET + "Solo Mode", - ChatColor.RESET + "", - ChatColor.RESET + "Click to play!", - ChatColor.RESET + "", - ChatColor.RESET + "Teaming in Solo Mode is bannable!", - })); - - setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL.getId(), (byte)0, 2, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Play Team " + C.cGray + getName(), new String[] - { - ChatColor.RESET + "Team Mode", - ChatColor.RESET + "", - ChatColor.RESET + "Click to play!" - })); - */ List serverList = new ArrayList(getPlugin().GetServerList(_serverNpcKey)); int slotsNeeded = 1; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java index 5eb10705b..0098e9c6f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerTypePage.java @@ -48,8 +48,6 @@ public class ServerTypePage extends ShopPageBase @Override protected void buildPage() { - String name = _serverGroup.getName(); - String friendlyName = _serverGroup.getServerNpcName(); setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[]