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

This commit is contained in:
Chiss 2013-11-23 23:59:04 +11:00
commit fd63a0a0b1
3 changed files with 46 additions and 27 deletions

View File

@ -607,6 +607,16 @@ public class ServerManager extends MiniPlugin
return _serverNpcShopMap.get("Minekart");
}
public ServerNpcShop getSurvivalGamesShop()
{
return _serverNpcShopMap.get("Survival Games Beta");
}
public ServerNpcShop getBlockHuntShop()
{
return _serverNpcShopMap.get("Block Hunt");
}
private Vector ParseVector(String vectorString)
{
Vector vector = new Vector();

View File

@ -39,8 +39,15 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
@Override
protected void BuildPage()
{
this.setItem(2, _superSmashCycle.get(_ssmIndex));
this.setItem(3, _minigameCycle.get(_minigameIndex));
this.setItem(1, _superSmashCycle.get(_ssmIndex));
this.setItem(2, _minigameCycle.get(_minigameIndex));
this.setItem(3, 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[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Search for chests to find loot and ",
ChatColor.RESET + "fight others to be the last man standing. ",
ChatColor.RESET + "Beware of the deep freeze!",
}));
this.setItem(4, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[]
{
ChatColor.RESET + "",
@ -49,7 +56,14 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "breaks loose as you battle to the",
ChatColor.RESET + "death with the other teams.",
}));
this.setItem(5, ItemStackFactory.Instance.CreateStack(Material.SADDLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "MineKart " + C.cGray + "Racing", new String[]
this.setItem(5, ItemStackFactory.Instance.CreateStack(Material.ANVIL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Hide as blocks/animals, upgrade your ",
ChatColor.RESET + "weapon and fight to survive against",
ChatColor.RESET + "the Hunters!",
}));
this.setItem(6, ItemStackFactory.Instance.CreateStack(Material.SADDLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "MineKart " + C.cGray + "Racing", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Pick your Kart and race against other",
@ -57,7 +71,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "with weapons, drifting and more!",
}));
this.setItem(6, ItemStackFactory.Instance.CreateStack(Material.BEACON.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Champions " + C.cGray + "Team Game", new String[]
this.setItem(7, ItemStackFactory.Instance.CreateStack(Material.BEACON.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Champions " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Customize one of five exciting champions",
@ -65,11 +79,13 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "control points on the map.",
}));
ButtonMap.put(2, new SelectSSMButton(this));
ButtonMap.put(3, new SelectMINButton(this));
ButtonMap.put(1, new SelectSSMButton(this));
ButtonMap.put(2, new SelectMINButton(this));
ButtonMap.put(3, new SelectSGButton(this));
ButtonMap.put(4, new SelectBRButton(this));
ButtonMap.put(5, new SelectMKButton(this));
ButtonMap.put(6, new SelectDOMButton(this));
ButtonMap.put(5, new SelectBHButton(this));
ButtonMap.put(6, new SelectMKButton(this));
ButtonMap.put(7, new SelectDOMButton(this));
}
private void createTurfFortsCycle()
@ -301,9 +317,6 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
};
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)1, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs", desc));
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)2, 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", desc));
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs", desc));
}
public void Update()
@ -348,4 +361,14 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
Plugin.getMinekartShop().attemptShopOpen(player);
}
public void OpenBH(Player player)
{
Plugin.getBlockHuntShop().attemptShopOpen(player);
}
public void OpenSG(Player player)
{
Plugin.getSurvivalGamesShop().attemptShopOpen(player);
}
}

View File

@ -113,15 +113,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
}
else
{
if (getName().contains("Beta"))
{
if (DonationManager.Get(Player.getName()).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!");
lore.add(ChatColor.RESET + C.Line + "Click to join!");
}
greenCount++;
@ -199,13 +191,7 @@ public class ServerNpcPage extends ShopPageBase<ServerManager, ServerNpcShop> im
}
public void SelectServer(Player player, ServerInfo serverInfo)
{
if (getName().contains("Beta") && !(DonationManager.Get(Player.getName()).OwnsUltraPackage() || Client.GetRank().Has(Rank.ULTRA)))
{
PlayDenySound(player);
return;
}
{
int slots = Plugin.GetRequiredSlots(player, serverInfo.ServerType);
if (serverInfo.MaxPlayers - serverInfo.CurrentPlayers < slots && !(DonationManager.Get(Player.getName()).OwnsUnknownPackage(serverInfo.ServerType + " ULTRA") || Client.GetRank().Has(Rank.ULTRA)))