[Hub] Add UHC to Quick server menu. Better formatting coming soon!

This commit is contained in:
Shaun Bennett 2015-05-13 22:52:14 -05:00
parent 3b024de521
commit 84c53347f8
3 changed files with 53 additions and 8 deletions

View File

@ -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");

View File

@ -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<ServerManager, QuickShop>
@ -144,7 +145,17 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + 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(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(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<ServerManager, QuickShop>
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<ServerManager, QuickShop>
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<ServerManager, QuickShop>
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<ServerManager, QuickShop>
getPlugin().getBetaShop().attemptShopOpen(player);
}
public void openUHC(Player player)
{
getPlugin().getUHCShop().attemptShopOpen(player);
}
public void openPlayerGames(Player player)
{
getPlugin().getPlayerGamesShop().attemptShopOpen(player);

View File

@ -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);
}
}