Add UHC subtypes to server menu

This commit is contained in:
cnr 2017-03-22 22:36:53 -05:00
parent 441e2ab30f
commit 222e4267d2
2 changed files with 69 additions and 0 deletions

View File

@ -33,6 +33,9 @@ public class ServerNpcShop extends ShopBase<ServerManager>
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());
}

View File

@ -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<ServerManager, ServerNpcShop>
{
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();
}
}