From ae779d063e77799ed9eff039f170df3ab54c3e04 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sat, 23 Nov 2013 02:04:22 -0800 Subject: [PATCH] Added quick menu buttons for Block Hunt and Survival Games --- .../mineplex/hub/server/ServerManager.java | 10 +++++ .../hub/server/ui/ServerGameMenu.java | 45 ++++++++++++++----- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index d08242d0f..9fae1b2ef 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -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(); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index ead4e5594..f96b141da 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -39,8 +39,15 @@ public class ServerGameMenu extends ShopPageBase @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 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 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 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 }; _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 { Plugin.getMinekartShop().attemptShopOpen(player); } + + public void OpenBH(Player player) + { + Plugin.getBlockHuntShop().attemptShopOpen(player); + } + + public void OpenSG(Player player) + { + Plugin.getSurvivalGamesShop().attemptShopOpen(player); + } }