From 84c53347f87c0b972d0b7074cc080bb093dfceec Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Wed, 13 May 2015 22:52:14 -0500 Subject: [PATCH] [Hub] Add UHC to Quick server menu. Better formatting coming soon! --- .../mineplex/hub/server/ServerManager.java | 5 +++ .../hub/server/ui/ServerGameMenu.java | 33 ++++++++++++++----- .../hub/server/ui/button/SelectUHCButton.java | 23 +++++++++++++ 3 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectUHCButton.java diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index 013ebce6e..c59880714 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -715,6 +715,11 @@ public class ServerManager extends MiniPlugin return _serverNpcShopMap.get("Beta Games"); } + public ServerNpcShop getUHCShop() + { + return _serverNpcShopMap.get("Ultra Hardcore"); + } + public ServerNpcShop getPlayerGamesShop() { return _serverNpcShopMap.get("Mineplex Player Servers"); 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 da19364e2..18734c897 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -27,6 +27,7 @@ import mineplex.hub.server.ui.button.SelectPLAYERButton; import mineplex.hub.server.ui.button.SelectSGButton; import mineplex.hub.server.ui.button.SelectSSMButton; import mineplex.hub.server.ui.button.SelectTDMButton; +import mineplex.hub.server.ui.button.SelectUHCButton; import mineplex.hub.server.ui.button.SelectWIZButton; public class ServerGameMenu extends ShopPageBase @@ -143,8 +144,18 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "", ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + ChatColor.RESET + " other players!", })); + + setItem(36, ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "UHC " + C.cGray + "Ultra Hardcore Mode", new String[] + { + ChatColor.RESET + "", + ChatColor.RESET + "Extremely hard team-based survival ", + ChatColor.RESET + "Gather materials and fight your way", + ChatColor.RESET + "to become the last team standing!", + ChatColor.RESET + "", + ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("UHC") + ChatColor.RESET + " other players!", + })); - setItem(37, ItemStackFactory.Instance.CreateStack(Material.WOOD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Master Builders " + C.cGray + "Creative Build", new String[] + setItem(38, ItemStackFactory.Instance.CreateStack(Material.WOOD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Master Builders " + C.cGray + "Creative Build", new String[] { ChatColor.RESET + "", ChatColor.RESET + "Players are given a Build Theme and ", @@ -154,9 +165,9 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!", })); - setItem(39, _minigameCycle.get(_minigameIndex)); + setItem(40, _minigameCycle.get(_minigameIndex)); - setItem(41, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Player Servers " + C.cGray + "Player Hosted Games", new String[] + setItem(42, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Player Servers " + C.cGray + "Player Hosted Games", new String[] { ChatColor.RESET + "", ChatColor.RESET + "Join your friends in their own ", @@ -165,7 +176,7 @@ public class ServerGameMenu extends ShopPageBase ChatColor.RESET + "", })); - setItem(43, ItemStackFactory.Instance.CreateStack(Material.ANVIL.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Beta Games " + C.cGray + "Play Unreleased Games", new String[] + setItem(44, ItemStackFactory.Instance.CreateStack(Material.ANVIL.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Beta Games " + C.cGray + "Play Unreleased Games", new String[] { ChatColor.RESET + "", ChatColor.RESET + "Help test and improve our ", @@ -185,10 +196,11 @@ public class ServerGameMenu extends ShopPageBase getButtonMap().put(22, new SelectDOMButton(this)); getButtonMap().put(24, new SelectTDMButton(this)); getButtonMap().put(26, new SelectBHButton(this)); - getButtonMap().put(37, new SelectBLDButton(this)); - getButtonMap().put(39, new SelectMINButton(this)); - getButtonMap().put(41, new SelectPLAYERButton(this)); - getButtonMap().put(43, new SelectBETAButton(this)); + getButtonMap().put(36, new SelectUHCButton(this)); + getButtonMap().put(38, new SelectBLDButton(this)); + getButtonMap().put(40, new SelectMINButton(this)); + getButtonMap().put(42, new SelectPLAYERButton(this)); + getButtonMap().put(44, new SelectBETAButton(this)); } @SuppressWarnings("deprecation") @@ -521,6 +533,11 @@ public class ServerGameMenu extends ShopPageBase getPlugin().getBetaShop().attemptShopOpen(player); } + public void openUHC(Player player) + { + getPlugin().getUHCShop().attemptShopOpen(player); + } + public void openPlayerGames(Player player) { getPlugin().getPlayerGamesShop().attemptShopOpen(player); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectUHCButton.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectUHCButton.java new file mode 100644 index 000000000..ce17cdd24 --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/button/SelectUHCButton.java @@ -0,0 +1,23 @@ +package mineplex.hub.server.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.shop.item.IButton; +import mineplex.hub.server.ui.ServerGameMenu; + +public class SelectUHCButton implements IButton +{ + private ServerGameMenu _menu; + + public SelectUHCButton(ServerGameMenu menu) + { + _menu = menu; + } + + @Override + public void onClick(Player player, ClickType clickType) + { + _menu.openUHC(player); + } +}