Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex

This commit is contained in:
Mini-Chiss 2015-08-03 10:06:30 +02:00
commit 8ec271bd82
4 changed files with 18 additions and 7 deletions

View File

@ -598,7 +598,7 @@ public class ServerManager extends MiniPlugin
{ {
ServerInfo largestServer = servers.get(0); ServerInfo largestServer = servers.get(0);
if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED) if (largestServer.getAvailableSlots() >= MIN_SLOTS_REQUIRED || largestServer.MaxPlayers > 40)
{ {
return largestServer; return largestServer;
} }
@ -618,6 +618,9 @@ public class ServerManager extends MiniPlugin
for (ServerInfo server : servers) for (ServerInfo server : servers)
{ {
if (isInProgress(server))
continue;
if (results.size() >= count) break; if (results.size() >= count) break;
if (server.getAvailableSlots() > requiredSlots) if (server.getAvailableSlots() > requiredSlots)
@ -629,6 +632,11 @@ public class ServerManager extends MiniPlugin
return results; return results;
} }
private boolean isInProgress(ServerInfo serverInfo)
{
return serverInfo.MOTD.contains("Progress") || serverInfo.MOTD.contains("Restarting");
}
public void ListServerNpcs(Player caller) public void ListServerNpcs(Player caller)
{ {
UtilPlayer.message(caller, F.main(getName(), "Listing Server Npcs:")); UtilPlayer.message(caller, F.main(getName(), "Listing Server Npcs:"));
@ -680,6 +688,9 @@ public class ServerManager extends MiniPlugin
{ {
for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null)) for (ServerGroup serverGroup : mineplex.serverdata.servers.ServerManager.getServerRepository(region).getServerGroups(null))
{ {
if (serverGroup.getName().equalsIgnoreCase("Lobby"))
addServerGroup(serverGroup);
if (!serverGroup.getServerNpcName().isEmpty()) if (!serverGroup.getServerNpcName().isEmpty())
{ {
if (!HasServerNpc(serverGroup.getServerNpcName())) if (!HasServerNpc(serverGroup.getServerNpcName()))
@ -805,7 +816,7 @@ public class ServerManager extends MiniPlugin
public ServerNpcShop getSKYShop() public ServerNpcShop getSKYShop()
{ {
return _serverNpcShopMap.get("SkyWars"); return _serverNpcShopMap.get("Skywars");
} }
public ServerNpcShop getPlayerGamesShop() public ServerNpcShop getPlayerGamesShop()

View File

@ -64,7 +64,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!", ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
})); }));
setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Last Man Standing", new String[] setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
{ {
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + "Search for chests to find loot and ", ChatColor.RESET + "Search for chests to find loot and ",
@ -74,7 +74,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("HG") + ChatColor.RESET + " other players!", ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("HG") + ChatColor.RESET + " other players!",
})); }));
setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo Survival", new String[] setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo/Team Survival", new String[]
{ {
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + "16 contenders fight for the right to rule the skies!", ChatColor.RESET + "16 contenders fight for the right to rule the skies!",
@ -456,7 +456,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("SSM") + ChatColor.RESET + " other players!", ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("SSM") + ChatColor.RESET + " other players!",
}; };
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs", desc)); _superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch", desc));
} }
public void Update() public void Update()

View File

@ -42,7 +42,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverNpcKey) public ServerNpcPage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player, String serverNpcKey)
{ {
super(plugin, shop, clientManager, donationManager, name, player, 27); super(plugin, shop, clientManager, donationManager, name, player, 54);
_serverNpcKey = serverNpcKey; _serverNpcKey = serverNpcKey;

View File

@ -55,7 +55,7 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[] setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[]
{ {
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + C.cRed + C.Bold + "WARNING:" + ChatColor.RESET + "Teaming in Solo Mode is bannable!", ChatColor.RESET + C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "Teaming in Solo Mode is bannable!",
ChatColor.RESET + "", ChatColor.RESET + "",
ChatColor.RESET + C.cGreen + "Click to Play", ChatColor.RESET + C.cGreen + "Click to Play",
})); }));