Merge branch 'master' of ssh://dev.mineplex.com:7999/min/mineplex

This commit is contained in:
Chiss 2013-11-23 09:28:39 +11:00
commit 6e1f88c14f
2 changed files with 27 additions and 7 deletions

View File

@ -368,7 +368,8 @@ public class HubManager extends MiniClientPlugin<HubClient>
@EventHandler @EventHandler
public void InventoryCancel(InventoryClickEvent event) public void InventoryCancel(InventoryClickEvent event)
{ {
event.setCancelled(true); if (event.getWhoClicked() instanceof Player && ((Player)event.getWhoClicked()).getGameMode() != GameMode.CREATIVE)
event.setCancelled(true);
} }
@EventHandler @EventHandler

View File

@ -67,6 +67,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
for (ServerInfo serverInfo : serverList) for (ServerInfo serverInfo : serverList)
{ {
boolean ownsUltraPackage = DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA);
String inProgress = (serverInfo.Game == null || serverInfo.ServerType.equalsIgnoreCase("Competitive")) ? (ChatColor.RESET + C.Line + "Game in progress.") : (ChatColor.RESET + C.Line + "Click to spectate"); String inProgress = (serverInfo.Game == null || serverInfo.ServerType.equalsIgnoreCase("Competitive")) ? (ChatColor.RESET + C.Line + "Game in progress.") : (ChatColor.RESET + C.Line + "Click to spectate");
String inProgressLine2 = (serverInfo.Game == null || serverInfo.ServerType.equalsIgnoreCase("Competitive")) ? null : (ChatColor.RESET + C.Line + "and wait for next game!"); String inProgressLine2 = (serverInfo.Game == null || serverInfo.ServerType.equalsIgnoreCase("Competitive")) ? null : (ChatColor.RESET + C.Line + "and wait for next game!");
@ -97,13 +98,31 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers) if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers)
{ {
if (!Client.GetRank().Has(Rank.ULTRA)) if (!serverInfo.Game.equalsIgnoreCase("Survival Games"))
lore.add(openFull); {
lore.add(ChatColor.RESET + C.Line + "Full Survival Games servers");
lore.add(ChatColor.RESET + C.Line + "cannot be joined.");
}
else else
lore.add(openFullUltra); {
if (!ownsUltraPackage)
lore.add(openFull);
else
lore.add(openFullUltra);
}
} }
else else
lore.add(ChatColor.RESET + C.Line + "Click to join!"); {
if (serverInfo.Game.contains("Beta"))
{
if (ownsUltraPackage)
lore.add(ChatColor.RESET + C.Line + "Click to join!");
else
lore.add(ChatColor.RESET + C.Line + "Only Ultras can play games in Beta!");
}
else
lore.add(ChatColor.RESET + C.Line + "Click to join!");
}
greenCount++; greenCount++;
} }
@ -134,7 +153,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
} }
else if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers) else if (serverInfo.CurrentPlayers >= serverInfo.MaxPlayers)
{ {
if (!Client.GetRank().Has(Rank.ULTRA)) if (!Client.GetRank().Has(Rank.ULTRA) || ownsUltraPackage)
lore.add(openFull); lore.add(openFull);
else else
{ {
@ -183,7 +202,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
{ {
int slots = Plugin.GetRequiredSlots(player, serverInfo.ServerType); int slots = Plugin.GetRequiredSlots(player, serverInfo.ServerType);
if (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots) if (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA)))
{ {
PlayDenySound(player); PlayDenySound(player);
return; return;