Add Skyfall teams to game menu

This commit is contained in:
cnr 2017-04-14 23:11:08 -06:00
parent 2baaf4664e
commit 56e15ab2d9
2 changed files with 51 additions and 0 deletions

View File

@ -36,6 +36,9 @@ public class ServerNpcShop extends ShopBase<ServerManager>
case "UHC":
return new UHCServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player);
case "SF":
return new SkyfallServerTypePage(getPlugin(), this, getClientManager(), getDonationManager(), player);
default:
return new ServerNpcPage(getPlugin(), this, getClientManager(), getDonationManager(), _serverGroup.getServerNpcName(), player, _serverGroup.getPrefix());
}

View File

@ -0,0 +1,48 @@
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 SkyfallServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
{
public SkyfallServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
{
super(plugin, shop, clientManager, donationManager, "Skyfall", player, 27);
buildPage();
}
@Override
protected void buildPage()
{
setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Skyfall Solo")
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGreen + "Click to Play",
}).build());
setItem(14, new ItemBuilder(Material.SKULL_ITEM, 2, (byte) 3).setTitle(C.Reset + C.cYellow + "Skyfall Teams")
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGreen + "Click to Play"
}).build());
getButtonMap().put(12, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Skyfall Solo", player, "SF")));
getButtonMap().put(14, (player, __) -> getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Skyfall Teams", player, "SF2")));
}
public void Update()
{
getButtonMap().clear();
buildPage();
}
}