From 222e4267d2f3eed163d10c9a7be97ab4eec2d68b Mon Sep 17 00:00:00 2001 From: cnr Date: Wed, 22 Mar 2017 22:36:53 -0500 Subject: [PATCH] Add UHC subtypes to server menu --- .../mineplex/hub/server/ui/ServerNpcShop.java | 3 + .../hub/server/ui/UHCServerTypePage.java | 66 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/UHCServerTypePage.java diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java index 735066e80..107f9fb16 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerNpcShop.java @@ -33,6 +33,9 @@ public class ServerNpcShop extends ShopBase case "MS": return new MinestrikeServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player, _serverGroup); + case "UHC": + return new UHCServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player); + default: return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), _serverGroup.getServerNpcName(), player, _serverGroup.getPrefix()); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/UHCServerTypePage.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/UHCServerTypePage.java new file mode 100644 index 000000000..76cc3595b --- /dev/null +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/UHCServerTypePage.java @@ -0,0 +1,66 @@ +package mineplex.hub.server.ui; + +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.donation.DonationManager; +import mineplex.core.itemstack.ItemBuilder; +import mineplex.core.shop.page.ShopPageBase; +import mineplex.hub.server.ServerManager; + +public class UHCServerTypePage extends ShopPageBase + +{ + public UHCServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, + DonationManager donationManager, Player player) + { + super(plugin, shop, clientManager, donationManager, "Ultra Hardcore", player, 27); + + buildPage(); + } + + @Override + protected void buildPage() + { + setItem(10, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "UHC Solo") + .addLore(new String[] + { + C.Reset + "", + C.Reset + C.cGreen + "Click to Play", + }).build()); + + setItem(12, new ItemBuilder(Material.SKULL_ITEM, 2, (byte) 3).setTitle(C.Reset + C.cYellow + "UHC Teams") + .addLore(new String[] + { + C.Reset + "", + C.Reset + C.cGreen + "Click to Play", + }).build()); + + setItem(14, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "UHC Speed Solo") + .addLore(new String[] + { + C.Reset + "", + C.Reset + C.cGreen + "Click to Play" + }).build()); + + setItem(16, new ItemBuilder(Material.SKULL_ITEM, 2, (byte) 3).setTitle(C.Reset + C.cYellow + "UHC Speed Teams") + .addLore(new String[] + { + C.Reset + "", + C.Reset + C.cGreen + "Click to Play" + }).build()); + + getButtonMap().put(10, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "UHC Solo", player, "UHC2"))); + getButtonMap().put(12, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "UHC", player, "UHC"))); + getButtonMap().put(14, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "UHC Speed Solo", player, "UHCS2"))); + getButtonMap().put(16, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "UHC Speed", player, "UHCS"))); + } + + public void Update() + { + getButtonMap().clear(); + buildPage(); + } +}