Change ItemBuilder to have ItemFlag, change hub icons to not display weapon damage

This commit is contained in:
libraryaddict 2015-12-13 16:40:46 +13:00
parent 402530d671
commit 9058428484
4 changed files with 530 additions and 489 deletions

View File

@ -2,7 +2,9 @@ package mineplex.core.itemstack;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@ -12,6 +14,7 @@ import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkEffectMeta;
import org.bukkit.inventory.meta.ItemMeta;
@ -19,6 +22,8 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.potion.Potion;
import mineplex.core.common.util.C;
public class ItemBuilder
{
@ -48,20 +53,17 @@ public class ItemBuilder
private final HashMap<Enchantment, Integer> _enchants = new HashMap<Enchantment, Integer>();
private final List<String> _lore = new ArrayList<String>();
private Material _mat;
// private Potion potion;
private String _title = null;
private boolean _unbreakable;
private String _playerHeadName = null;
private HashSet<ItemFlag> _itemFlags = new HashSet<ItemFlag>();
public ItemBuilder(ItemStack item)
{
this(item.getType(), item.getDurability());
_amount = item.getAmount();
_enchants.putAll(item.getEnchantments());
if (item.getType() == Material.POTION)
{
// setPotion(Potion.fromItemStack(item));
}
if (item.hasItemMeta())
{
ItemMeta meta = item.getItemMeta();
@ -81,6 +83,8 @@ public class ItemBuilder
setColor(((LeatherArmorMeta) meta).getColor());
}
_itemFlags.addAll(meta.getItemFlags());
_unbreakable = meta.spigot().isUnbreakable();
}
}
@ -107,13 +111,60 @@ public class ItemBuilder
this(mat, 1, data);
}
public HashSet<ItemFlag> getItemFlags()
{
return _itemFlags;
}
public ItemBuilder addItemFlags(ItemFlag... flags)
{
getItemFlags().addAll(Arrays.asList(flags));
return this;
}
public ItemBuilder setItemFlags(ItemFlag... flags)
{
getItemFlags().clear();
addItemFlags(flags);
return this;
}
public ItemBuilder setItemFlags(Collection<ItemFlag> flags)
{
getItemFlags().clear();
addItemFlags(flags.toArray(new ItemFlag[0]));
return this;
}
public ItemBuilder setHideInfo(boolean hideInfo)
{
if (hideInfo)
{
for (ItemFlag flag : ItemFlag.values())
{
getItemFlags().add(flag);
}
}
else
{
getItemFlags().clear();
}
return this;
}
public ItemBuilder addEnchantment(Enchantment enchant, int level)
{
if (_enchants.containsKey(enchant))
{
_enchants.remove(enchant);
}
_enchants.put(enchant, level);
return this;
}
@ -121,20 +172,31 @@ public class ItemBuilder
{
for (String lore : lores)
{
_lore.add(ChatColor.GRAY + lore);
_lore.add(C.cGray + lore);
}
return this;
}
public ItemBuilder setLore(String... lores)
{
_lore.clear();
_lore.addAll(Arrays.asList(lores));
return this;
}
public ItemBuilder addLore(String lore, int maxLength)
{
_lore.addAll(split(lore, maxLength));
return this;
}
public ItemBuilder addLores(List<String> lores)
{
_lore.addAll(lores);
return this;
}
@ -144,6 +206,7 @@ public class ItemBuilder
{
addLore(lore, maxLength);
}
return this;
}
@ -155,6 +218,7 @@ public class ItemBuilder
public ItemStack build()
{
Material mat = _mat;
if (mat == null)
{
mat = Material.AIR;
@ -164,8 +228,10 @@ public class ItemBuilder
{
Bukkit.getLogger().warning("Air material!");
}
ItemStack item = new ItemStack(mat, _amount, _data);
ItemMeta meta = item.getItemMeta();
if (meta != null)
{
if (_title != null)
@ -189,14 +255,13 @@ public class ItemBuilder
((FireworkEffectMeta) meta).setEffect(FireworkEffect.builder().withColor(_color).build());
}
meta.addItemFlags(getItemFlags().toArray(new ItemFlag[0]));
meta.spigot().setUnbreakable(isUnbreakable());
item.setItemMeta(meta);
}
item.addUnsafeEnchantments(_enchants);
// if (potion != null) {
// potion.apply(item);
// }
return item;
}
@ -263,52 +328,6 @@ public class ItemBuilder
return _enchants.containsKey(enchant);
}
public boolean isItem(ItemStack item)
{
ItemMeta meta = item.getItemMeta();
if (item.getType() != getType())
{
return false;
}
if (!meta.hasDisplayName() && getTitle() != null)
{
return false;
}
if (!meta.getDisplayName().equals(getTitle()))
{
return false;
}
if (!meta.hasLore() && !getLore().isEmpty())
{
return false;
}
if (meta.hasLore())
{
for (String lore : meta.getLore())
{
if (!getLore().contains(lore))
{
return false;
}
}
}
for (Enchantment enchant : item.getEnchantments().keySet())
{
if (!hasEnchantment(enchant))
{
return false;
}
}
return true;
}
public boolean isUnbreakable()
{
return _unbreakable;
@ -317,17 +336,14 @@ public class ItemBuilder
public ItemBuilder setAmount(int amount)
{
_amount = amount;
return this;
}
public ItemBuilder setColor(Color color)
{
/* (!_mat.name().contains("LEATHER_"))
{
throw new IllegalArgumentException("Can only dye leather armor!");
}*/
_color = color;
return this;
}
@ -338,19 +354,10 @@ public class ItemBuilder
return this;
}
public ItemBuilder setPotion(Potion potion)
{
if (_mat != Material.POTION)
{
_mat = Material.POTION;
}
return this;
}
public ItemBuilder setRawTitle(String title)
{
_title = title;
return this;
}
@ -378,24 +385,28 @@ public class ItemBuilder
}
setTitle(title);
return this;
}
public ItemBuilder setType(Material mat)
{
_mat = mat;
return this;
}
public ItemBuilder setUnbreakable(boolean setUnbreakable)
{
_unbreakable = setUnbreakable;
return this;
}
public ItemBuilder setPlayerHead(String playerName)
{
_playerHeadName = playerName;
return this;
}

View File

@ -2,6 +2,7 @@ package mineplex.hub.profile.buttons;
import mineplex.core.common.util.C;
import mineplex.core.gui.GuiItem;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.hub.profile.gui.GUIProfile;
@ -17,7 +18,7 @@ public class ButtonPrefs implements GuiItem
private GUIProfile _profile;
private Player _player;
public ButtonPrefs(GUIProfile profile, Player player)
{
_profile = profile;
@ -33,29 +34,27 @@ public class ButtonPrefs implements GuiItem
@Override
public ItemStack getObject()
{
return ItemStackFactory.Instance.CreateStack(Material.REDSTONE_COMPARATOR.getId(), (byte)0, 1,
ChatColor.RESET + C.cYellow + "Preferences",
new String[]
{
"",
C.cWhite + "Set your preferences to your liking",
C.cWhite + "so you can enjoy the game more!",
"",
C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!"
});
return new ItemBuilder(Material.REDSTONE_COMPARATOR).setTitle(C.Reset + C.cYellow + "Preferences").addLore(new String[]
{
"",
C.cWhite + "Set your preferences to your liking",
C.cWhite + "so you can enjoy the game more!",
"",
C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!"
}).build();
}
@Override
public void setup()
public void setup()
{
}
@Override
public void close()
{
}
}

View File

@ -3,7 +3,6 @@ package mineplex.hub.server.ui;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -11,7 +10,7 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager;
import mineplex.hub.server.ui.button.SelectBHButton;
@ -34,17 +33,18 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
private List<ItemStack> _superSmashCycle = new ArrayList<ItemStack>();
private List<ItemStack> _minigameCycle = new ArrayList<ItemStack>();
private int _ssmIndex;
private int _minigameIndex;
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager,
DonationManager donationManager, String name, Player player)
{
super(plugin, quickShop, clientManager, donationManager, name, player, 47);
createSuperSmashCycle();
createMinigameCycle();
buildPage();
}
@ -52,148 +52,165 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
@Override
protected void buildPage()
{
setItem(0, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "4 Teams get 10 minutes to prepare.",
ChatColor.RESET + "Then the bridges drop, and all hell",
ChatColor.RESET + "breaks loose as you battle to the",
ChatColor.RESET + "death with the other teams.",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
}));
setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Search for chests to find loot and ",
ChatColor.RESET + "fight others to be the last man standing. ",
ChatColor.RESET + "Stay away from the borders!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + ChatColor.RESET + " other players!",
}));
setItem(0, new ItemBuilder(Material.IRON_PICKAXE)
.setTitle(C.Reset + C.Bold + C.cYellow + "The Bridges " + C.cGray + "4 Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "4 Teams get 10 minutes to prepare.",
C.Reset + "Then the bridges drop, and all hell",
C.Reset + "breaks loose as you battle to the",
C.Reset + "death with the other teams.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BR") + C.Reset + " other players!"
}).setHideInfo(true).build());
setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo/Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "16 contenders fight for the right to rule the skies!",
ChatColor.RESET + "Spawn on a sky island and build your path!",
ChatColor.RESET + "Find weapons to take your enemies down!",
ChatColor.RESET + "Way up there, death ever looming if you fall..",
ChatColor.RESET + "Can you fight? Can you live? Can you win Skywars?",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + ChatColor.RESET + " other players!",
}));
setItem(2, new ItemBuilder(Material.DIAMOND_SWORD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Survival Games " + C.cGray + "Solo/Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "Search for chests to find loot and ",
C.Reset + "fight others to be the last man standing. ",
C.Reset + "Stay away from the borders!",
C.Reset + "",
C.Reset + "Join " + C.cGreen
+ (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + C.Reset
+ " other players!"
}).setHideInfo(true).build());
setItem(6, 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(4, new ItemBuilder(Material.FEATHER)
.setTitle(C.Reset + C.Bold + C.cYellow + "Skywars " + C.cGray + "Solo/Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "16 contenders fight to rule the skies!",
C.Reset + "Spawn on a sky island and build your path!",
C.Reset + "Find weapons to take your enemies down!",
C.Reset + "Up in the skies, death looming if you fall..",
C.Reset + "Win! Fight! Send enemies flying in Skywars!",
C.Reset + "",
C.Reset + "Join " + C.cGreen
+ (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + C.Reset
+ " other players!",
}).setHideInfo(true).build());
setItem(8, ItemStackFactory.Instance.CreateStack(Material.BLAZE_ROD.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Wizards " + C.cGray + "Last Man Standing", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Wield powerful spells to fight",
ChatColor.RESET + "against other players in this",
ChatColor.RESET + "exciting free-for-all brawl!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("WIZ") + ChatColor.RESET + " other players!",
}));
setItem(6, new ItemBuilder(Material.GOLDEN_APPLE)
.setTitle(C.Reset + C.Bold + C.cYellow + "UHC " + C.cGray + "Ultra Hardcore Mode").addLore(new String[]
{
C.Reset + "",
C.Reset + "Extremely hard team-based survival ",
C.Reset + "Gather materials and fight your way",
C.Reset + "to become the last team standing!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("UHC") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(18, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Castle Siege " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Defenders must protect King Sparklez",
ChatColor.RESET + "from the endless waves of Undead",
ChatColor.RESET + "until the sun rises!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("CS") + ChatColor.RESET + " other players!",
}));
setItem(8, new ItemBuilder(Material.BLAZE_ROD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Wizards " + C.cGray + "Last Man Standing").addLore(new String[]
{
C.Reset + "",
C.Reset + "Wield powerful spells to fight",
C.Reset + "against other players in this",
C.Reset + "exciting free-for-all brawl!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("WIZ") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(20, ItemStackFactory.Instance.CreateStack(Material.GRASS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Hide as blocks/animals, upgrade your ",
ChatColor.RESET + "weapon and fight to survive against",
ChatColor.RESET + "the Hunters!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + ChatColor.RESET + " other players!",
}));
setItem(18, new ItemBuilder(Material.DIAMOND_CHESTPLATE)
.setTitle(C.Reset + C.Bold + C.cYellow + "Castle Siege " + C.cGray + "Team Game").addLore(new String[]
{
C.Reset + "",
C.Reset + "Defenders must protect King Sparklez",
C.Reset + "from the endless waves of Undead",
C.Reset + "until the sun rises!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("CS") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(20, new ItemBuilder(Material.GRASS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Block Hunt " + C.cGray + "Cat and Mouse").addLore(new String[]
{
C.Reset + "",
C.Reset + "Hide as blocks/animals, upgrade your ",
C.Reset + "weapon and fight to survive against",
C.Reset + "the Hunters!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BH") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(22, _superSmashCycle.get(_ssmIndex));
setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike " + C.cGray + "Team Survival", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "One team must defend two bomb sites from",
ChatColor.RESET + "the other team, who are trying to plant a bomb",
ChatColor.RESET + "and blow them up!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("MS") + ChatColor.RESET + " other players!",
}));
setItem(26, ItemStackFactory.Instance.CreateStack(Material.BOOK_AND_QUILL.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Draw My Thing " + C.cGray + "Pictionary!", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Players take turns at drawing a random",
ChatColor.RESET + "word. Whoever guesses it within the time",
ChatColor.RESET + "limit gets some points!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DMT") + ChatColor.RESET + " other players!",
}));
setItem(36, ItemStackFactory.Instance.CreateStack(Material.BEACON.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Dominate " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Customize one of five exciting champions",
ChatColor.RESET + "and battle with the opposing team for the",
ChatColor.RESET + "control points on the map.",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DOM") + ChatColor.RESET + " other players!",
}));
setItem(38, ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Team Deathmatch " + C.cGray + "Team Game", new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Customize one of five exciting champions",
ChatColor.RESET + "and battle with the opposing team to the",
ChatColor.RESET + "last man standing.",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("TDM") + ChatColor.RESET + " other players!",
}));
setItem(40, 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 ",
ChatColor.RESET + "must use blocks, monsters and more",
ChatColor.RESET + "to create a masterpiece!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!",
}));
setItem(24, new ItemBuilder(Material.TNT)
.setTitle(C.Reset + C.Bold + C.cYellow + "Mine-Strike " + C.cGray + "Team Survival").addLore(new String[]
{
C.Reset + "",
C.Reset + "One team must defend two bomb sites from",
C.Reset + "the other team, who are trying to plant a bomb",
C.Reset + "and blow them up!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("MS") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(26, new ItemBuilder(Material.BOOK_AND_QUILL)
.setTitle(C.Reset + C.Bold + C.cYellow + "Draw My Thing " + C.cGray + "Pictionary!").addLore(new String[]
{
C.Reset + "",
C.Reset + "Players take turns at drawing a random",
C.Reset + "word. Whoever guesses it within the time",
C.Reset + "limit gets some points!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(36, new ItemBuilder(Material.BEACON).setTitle(C.Reset + C.Bold + C.cYellow + "Dominate " + C.cGray + "Team Game")
.addLore(new String[]
{
C.Reset + "",
C.Reset + "Customize one of five exciting champions",
C.Reset + "and battle with the opposing team for the",
C.Reset + "control points on the map.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DOM") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(38, new ItemBuilder(Material.GOLD_SWORD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Team Deathmatch " + C.cGray + "Team Game").addLore(new String[]
{
C.Reset + "",
C.Reset + "Customize one of five exciting champions",
C.Reset + "and battle with the opposing team to the",
C.Reset + "last man standing.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("TDM") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(40, new ItemBuilder(Material.WOOD)
.setTitle(C.Reset + C.Bold + C.cYellow + "Master Builders " + C.cGray + "Creative Build").addLore(new String[]
{
C.Reset + "",
C.Reset + "Players are given a Build Theme and ",
C.Reset + "must use blocks, monsters and more",
C.Reset + "to create a masterpiece!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BLD") + C.Reset + " other players!",
}).setHideInfo(true).build());
setItem(42, _minigameCycle.get(_minigameIndex));
setItem(44, 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 ",
ChatColor.RESET + "Mineplex Player Server. You can play",
ChatColor.RESET + "the games you want, when you want.",
ChatColor.RESET + "",
}));
setItem(44, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3)
.addLore(C.Reset + C.Bold + C.cYellow + "Player Servers " + C.cGray + "Player Hosted Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Join your friends in their own ",
C.Reset + "Mineplex Player Server. You can play",
C.Reset + "the games you want, when you want.",
C.Reset + "",
}).setHideInfo(true).build());
getButtonMap().put(0, new SelectBRButton(this));
getButtonMap().put(2, new SelectSGButton(this));
getButtonMap().put(4, new SelectSKYButton(this));
getButtonMap().put(6, new SelectUHCButton(this));
getButtonMap().put(8, new SelectWIZButton(this));
getButtonMap().put(18, new SelectCSButton(this));
getButtonMap().put(20, new SelectBHButton(this));
getButtonMap().put(22, new SelectSSMButton(this));
@ -204,271 +221,280 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
getButtonMap().put(40, new SelectBLDButton(this));
getButtonMap().put(42, new SelectMINButton(this));
getButtonMap().put(44, new SelectPLAYERButton(this));
// getButtonMap().put(44, new SelectBETAButton(this));
// getButtonMap().put(44, new SelectBETAButton(this));
}
@SuppressWarnings("deprecation")
private void createMinigameCycle()
{
int playerCount = getPlugin().getGroupTagPlayerCount("MIN") +
getPlugin().getGroupTagPlayerCount("DR") +
getPlugin().getGroupTagPlayerCount("DE") +
getPlugin().getGroupTagPlayerCount("PB") +
getPlugin().getGroupTagPlayerCount("TF") +
getPlugin().getGroupTagPlayerCount("RUN") +
getPlugin().getGroupTagPlayerCount("SN") +
getPlugin().getGroupTagPlayerCount("DT") +
getPlugin().getGroupTagPlayerCount("SQ") +
getPlugin().getGroupTagPlayerCount("SA") +
getPlugin().getGroupTagPlayerCount("SS") +
getPlugin().getGroupTagPlayerCount("OITQ");
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(98, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(122, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.LEATHER_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BARDING.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(159, (byte)14, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(309, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Death Tag",
ChatColor.RESET + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(319, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
{
ChatColor.RESET + "",
ChatColor.RESET + "Play all of these fun minigames:",
ChatColor.RESET + "",
ChatColor.RESET + "Super Spleef",
ChatColor.RESET + "Runner",
ChatColor.RESET + "Dragons",
ChatColor.RESET + "One in the Quiver",
ChatColor.RESET + "Dragon Escape",
ChatColor.RESET + "Sneaky Assassins",
ChatColor.RESET + "Micro Battle",
ChatColor.RESET + "Super Paintball",
ChatColor.RESET + "Turf Wars",
ChatColor.RESET + "Death Tag",
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Bacon Brawl",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
}));
int playerCount = getPlugin().getGroupTagPlayerCount("MIN") + getPlugin().getGroupTagPlayerCount("DR")
+ getPlugin().getGroupTagPlayerCount("DE") + getPlugin().getGroupTagPlayerCount("PB")
+ getPlugin().getGroupTagPlayerCount("TF") + getPlugin().getGroupTagPlayerCount("RUN")
+ getPlugin().getGroupTagPlayerCount("SN") + getPlugin().getGroupTagPlayerCount("DT")
+ getPlugin().getGroupTagPlayerCount("SQ") + getPlugin().getGroupTagPlayerCount("SA")
+ getPlugin().getGroupTagPlayerCount("SS") + getPlugin().getGroupTagPlayerCount("OITQ");
_minigameCycle.add(new ItemBuilder(Material.SMOOTH_BRICK)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + C.Bold + C.cGreen + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.GOLD_BOOTS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + C.Bold + C.cGreen + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.DRAGON_EGG)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + C.Bold + C.cGreen + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.BOW)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + C.Bold + C.cGreen + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.LEATHER_BOOTS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + C.Bold + C.cGreen + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + C.Bold + C.cGreen + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + C.Bold + C.cGreen + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.DIAMOND_BARDING)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + C.Bold + C.cGreen + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.STAINED_CLAY, 1, (byte) 14)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + C.Bold + C.cGreen + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.IRON_BOOTS)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + C.Bold + C.cGreen + "Death Tag",
C.Reset + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
_minigameCycle.add(new ItemBuilder(Material.PORK)
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
{
C.Reset + "",
C.Reset + "Play all of these fun minigames:",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
C.Reset + "Dragons",
C.Reset + "One in the Quiver",
C.Reset + "Dragon Escape",
C.Reset + "Sneaky Assassins",
C.Reset + "Micro Battle",
C.Reset + "Super Paintball",
C.Reset + "Turf Wars",
C.Reset + "Death Tag",
C.Reset + C.Bold + C.cGreen + "Bacon Brawl",
C.Reset + "",
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
}).setHideInfo(true).build());
}
private void createSuperSmashCycle()
{
String[] desc = new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + "Pick from a selection of monsters,",
ChatColor.RESET + "then battle other players to the ",
ChatColor.RESET + "death with your monsters skills!",
ChatColor.RESET + "",
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + ChatColor.RESET + " other players!",
};
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch", desc));
String[] desc = new String[]
{
C.Reset + "",
C.Reset + "Pick from a selection of monsters,",
C.Reset + "then battle other players to the ",
C.Reset + "death with your monsters skills!",
C.Reset + "",
C.Reset + "Join " + C.cGreen
+ (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + C.Reset
+ " other players!",
};
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4)
.setTitle(C.Reset + C.Bold + C.cYellow + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc)
.setHideInfo(true).build());
}
public void Update()
{
_ssmIndex++;
_minigameIndex++;
if (_ssmIndex >= _superSmashCycle.size())
_ssmIndex = 0;
if (_minigameIndex >= _minigameCycle.size())
_minigameIndex = 0;
buildPage();
}
@ -491,12 +517,12 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
getPlugin().getCastleSiegeShop().attemptShopOpen(player);
}
public void OpenBR(Player player)
{
getPlugin().getBridgesShop().attemptShopOpen(player);
}
public void OpenBH(Player player)
{
getPlugin().getBlockHuntShop().attemptShopOpen(player);

View File

@ -18,6 +18,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilTime;
import mineplex.core.donation.DonationManager;
import mineplex.core.game.GameDisplay;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.item.ShopItem;
@ -35,11 +36,11 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
private ServerGroup _serverGroup;
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager,
Player player, ServerGroup serverGroup)
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager,
DonationManager donationManager, Player player, ServerGroup serverGroup)
{
super(plugin, shop, clientManager, donationManager, serverGroup.getServerNpcName(), player, 27);
_serverGroup = serverGroup;
buildPage();
@ -49,23 +50,25 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
protected void buildPage()
{
String friendlyName = _serverGroup.getServerNpcName();
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "Teaming in Solo Mode is bannable!",
ChatColor.RESET + "",
ChatColor.RESET + C.cGreen + "Click to Play",
}));
setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 2, ChatColor.RESET + C.cYellow + "Team " + friendlyName, new String[]
{
ChatColor.RESET + "",
ChatColor.RESET + C.cGray + "2 Player Teams",
ChatColor.RESET + "",
ChatColor.RESET + C.cGreen + "Click to Play"
}));
setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Solo " + friendlyName)
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cRed + C.Bold + "WARNING: " + C.Reset + "Teaming in Solo Mode is bannable!",
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 + "Team " + friendlyName)
.addLore(new String[]
{
C.Reset + "",
C.Reset + C.cGray + "2 Player Teams",
C.Reset + "",
C.Reset + C.cGreen + "Click to Play"
}).build());
getButtonMap().put(12, new SelectTypeButton(this, false));
getButtonMap().put(14, new SelectTypeButton(this, true));
}
@ -77,14 +80,16 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
}
public void selectServer(Player player, boolean team)
{
{
if (team)
{
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
}
else
{
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
}
}
}