Yo shaun debug this m8 ty

This commit is contained in:
Mysticate 2015-12-21 02:23:59 -05:00
parent 2593a473db
commit 0f5be6444b
10 changed files with 408 additions and 250 deletions

View File

@ -11,16 +11,17 @@ import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.DyeColor;
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.BannerMeta;
import org.bukkit.inventory.meta.FireworkEffectMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.potion.Potion;
import mineplex.core.common.util.C;
@ -254,6 +255,10 @@ public class ItemBuilder
{
((FireworkEffectMeta) meta).setEffect(FireworkEffect.builder().withColor(_color).build());
}
else if (meta instanceof BannerMeta)
{
((BannerMeta) meta).setBaseColor(DyeColor.getByColor(_color));
}
meta.addItemFlags(getItemFlags().toArray(new ItemFlag[0]));
meta.spigot().setUnbreakable(isUnbreakable());

View File

@ -13,7 +13,7 @@ public class TempRepository extends RepositoryBase
public TempRepository(JavaPlugin plugin)
{
super(plugin, DBPool.ACCOUNT);
super(plugin, DBPool.getAccount());
}
public void addGemBooster(String name, int amount)

View File

@ -23,7 +23,7 @@ public class PurchaseRepository extends RepositoryBase
public PurchaseRepository(JavaPlugin plugin)
{
super(plugin, DBPool.ACCOUNT);
super(plugin, DBPool.getAccount());
}
@Override

View File

@ -87,6 +87,8 @@ public class ServerManager extends MiniPlugin
private NautHashMap<String, ServerInfo> _serverInfoMap = new NautHashMap<String, ServerInfo>();
private NautHashMap<String, Long> _serverUpdate = new NautHashMap<String, Long>();
private NautHashMap<Vector, String> _serverPortalLocations = new NautHashMap<Vector, String>();
private ClansServerShop _clansShop;
// Join Time for Free Players Timer
private NautHashMap<String, Long> _joinTime = new NautHashMap<String, Long>();
@ -121,7 +123,7 @@ public class ServerManager extends MiniPlugin
//_domShop = new new QueueShop(_queueManager, clientManager, donationManager, "Dominate");
// TODO: Find more appropriate place to initialize Clans server shop?
new ClansServerShop(this, _clientManager, _donationManager);
_clansShop = new ClansServerShop(this, _clientManager, _donationManager);
}
@EventHandler(priority = EventPriority.LOW)
@ -786,6 +788,11 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Dominate");
}
public ServerNpcShop getCtfShop()
{
return _serverNpcShopMap.get("Capture the Flag");
}
public ServerNpcShop getBridgesShop()
{
@ -806,7 +813,7 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Beta Games");
}
public ServerNpcShop getUHCShop()
{
return _serverNpcShopMap.get("Ultra Hardcore");
@ -822,6 +829,11 @@ public class ServerManager extends MiniPlugin
return _serverNpcShopMap.get("Mineplex Player Servers");
}
public ServerNpcShop getShop(String name)
{
return _serverNpcShopMap.get(name);
}
private Vector ParseVector(String vectorString)
{
Vector vector = new Vector();
@ -882,4 +894,14 @@ public class ServerManager extends MiniPlugin
{
return _serverNpcShopMap.get("Master Builders");
}
public ClansServerShop getClansShop()
{
return _clansShop;
}
public ShopBase<ServerManager> getTypeWarsShop()
{
return _serverNpcShopMap.get("Type Wars");
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -12,15 +13,18 @@ import mineplex.core.account.CoreClientManager;
import mineplex.core.common.util.C;
import mineplex.core.donation.DonationManager;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.hub.server.ServerManager;
import mineplex.hub.server.ui.button.SelectBETAButton;
import mineplex.hub.server.ui.button.SelectBHButton;
import mineplex.hub.server.ui.button.SelectBLDButton;
import mineplex.hub.server.ui.button.SelectBRButton;
import mineplex.hub.server.ui.button.SelectCLANSButton;
import mineplex.hub.server.ui.button.SelectCSButton;
import mineplex.hub.server.ui.button.SelectCTFButton;
import mineplex.hub.server.ui.button.SelectDMTButton;
import mineplex.hub.server.ui.button.SelectDOMButton;
import mineplex.hub.server.ui.button.SelectFEATButton;
import mineplex.hub.server.ui.button.SelectMINButton;
import mineplex.hub.server.ui.button.SelectMSButton;
import mineplex.hub.server.ui.button.SelectPLAYERButton;
@ -28,6 +32,7 @@ import mineplex.hub.server.ui.button.SelectSGButton;
import mineplex.hub.server.ui.button.SelectSKYButton;
import mineplex.hub.server.ui.button.SelectSSMButton;
import mineplex.hub.server.ui.button.SelectTDMButton;
import mineplex.hub.server.ui.button.SelectTWButton;
import mineplex.hub.server.ui.button.SelectUHCButton;
import mineplex.hub.server.ui.button.SelectWIZButton;
@ -38,6 +43,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
private int _ssmIndex;
private int _minigameIndex;
private boolean _extraValue;
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager,
DonationManager donationManager, String name, Player player)
@ -50,246 +56,246 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
buildPage();
}
@SuppressWarnings("deprecation")
@Override
protected void buildPage()
{
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(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(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(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(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(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[]
addButton(13, new ItemBuilder(Material.IRON_SWORD).setTitle(C.cYellowB + "Gladiators" + C.cGray + " Bracketted Deathmatch").addLore(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[]
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED GAME " + C.cGray + "Arcade",
C.Reset + "",
C.Reset + "A 1v1 tournament.",
C.Reset + "Kill your enemy and then",
C.Reset + "run to the next arena!",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("GLD") + C.Reset + " other players!"
}).setHideInfo(true).build(), new SelectFEATButton(this, "Gladiators"));
addButton(18, new ItemBuilder(Material.IRON_PICKAXE).setTitle(C.cYellowB + "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(), new SelectBRButton(this));
addButton(19, new ItemBuilder(Material.DIAMOND_SWORD).setTitle(C.cYellowB + "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(), new SelectSGButton(this));
addButton(20, new ItemBuilder(Material.FEATHER).setTitle(C.cYellowB + "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(), new SelectSKYButton(this));
addButton(21, new ItemBuilder(Material.GOLDEN_APPLE).setTitle(C.cYellowB + "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(), new SelectUHCButton(this));
addButton(23, new ItemBuilder(Material.TNT).setTitle(C.cYellowB + "MineStrike " + 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(), new SelectMSButton(this));
addButton(24, new ItemBuilder(Material.BANNER).setColor(Color.RED).setTitle(C.cYellowB + "Capture the Flag " + C.cGray + "Team Game").addLore(new String[]
{
C.Reset + "",
C.Reset + "One team must steal the other",
C.Reset + "team's flag. Capture it",
C.Reset + "three times to win.",
C.Reset + "",
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("CTF") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectCTFButton(this));
addButton(25, new ItemBuilder(Material.BEACON).setTitle(C.cYellowB + "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 " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DOM") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectDOMButton(this));
addButton(26, new ItemBuilder(Material.GOLD_SWORD).setTitle(C.cYellowB + "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(), new SelectTDMButton(this));
addButton(27, new ItemBuilder(Material.BLAZE_ROD).setTitle(C.cYellowB + "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(), new SelectWIZButton(this));
addButton(28, new ItemBuilder(Material.DIAMOND_CHESTPLATE).setTitle(C.cYellowB + "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(), new SelectCSButton(this));
addButton(29, new ItemBuilder(Material.GRASS).setTitle(C.cYellowB + "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(), new SelectBHButton(this));
addButton(30, _superSmashCycle.get(_ssmIndex), new SelectSSMButton(this));
addButton(32, _minigameCycle.get(_minigameIndex), new SelectMINButton(this));
addButton(33, new ItemBuilder(Material.WOOD).setTitle(C.cYellowB + "Master Builders " + C.cGray + "Creative Build").setLore(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[]
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 " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectBLDButton(this));
addButton(34, new ItemBuilder(Material.NAME_TAG).setTitle(C.cYellowB + "Type Wars " + C.cGray + "Team Deathmatch").addLore(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());
C.Reset + "",
C.Reset + "Attack your enemies with",
C.Reset + "waves of mobs. Defend your giant",
C.Reset + "by typing the name of an enemy mob",
C.Reset + "to kill it.",
C.Reset + "",
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("TW") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectTWButton(this));
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());
addButton(35, new ItemBuilder(Material.BOOK_AND_QUILL).setTitle(C.cYellowB + "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 " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectDMTButton(this));
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());
addButton(46, new ItemBuilder(Material.SNOW_BALL).setTitle(C.cYellowB + "Snow Fight " + C.cGray + "Team Survival").addLore(new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "LIMITED TIME",
C.Reset + "",
C.Reset + "Harness the power of snow",
C.Reset + "to vanquish your enemies in",
C.Reset + "this ULTIMATE snowball fight!",
C.Reset + "",
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("SF") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectFEATButton(this, "Snow Fight"));
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());
addButton(48, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.cYellowB + "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.",
}).setHideInfo(true).build(), new SelectPLAYERButton(this));
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());
addButton(49, new ItemBuilder(Material.IRON_DOOR).setTitle(C.cYellowB + "Mineplex Clans " + C.cGray + "Champions Teams").addLore(new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "ALPHA RELEASE",
C.Reset + "",
C.Reset + "Equip custom skills and builds",
C.Reset + "and join your clan to destroy",
C.Reset + "and raid others!",
C.Reset + "",
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("Clans") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectCLANSButton(this));
setItem(42, _minigameCycle.get(_minigameIndex));
addButton(50, new ItemBuilder(Material.BREWING_STAND_ITEM).setTitle(C.cYellowB + "Monster Maze " + C.cGray + "Snow Sprint").addLore(new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "BETA GAME",
C.Reset + "",
C.Reset + "Run along a maze avoiding",
C.Reset + "evil monsters. Get to the",
C.Reset + "Safe-Pad or be killed!",
C.Reset + "",
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BETA") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectBETAButton(this));
setItem(44, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3)
.setTitle(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));
getButtonMap().put(24, new SelectMSButton(this));
getButtonMap().put(26, new SelectDMTButton(this));
getButtonMap().put(36, new SelectDOMButton(this));
getButtonMap().put(38, new SelectTDMButton(this));
getButtonMap().put(40, new SelectBLDButton(this));
getButtonMap().put(42, new SelectMINButton(this));
getButtonMap().put(44, new SelectPLAYERButton(this));
// getButtonMap().put(44, new SelectBETAButton(this));
addButton(52, new ItemBuilder(Material.BOOKSHELF).setTitle(C.cYellowB + "Christmas Chaos " + C.cGray + "Help Save Christmas").addLore(new String[]
{
(_extraValue ? C.cAquaB : C.cWhiteB) + "LIMITED TIME",
C.Reset + "",
C.Reset + "Band together with your friends",
C.Reset + "and help Santa save Christmas from",
C.Reset + "a deadly enemy...",
C.Reset + "",
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("CC") + C.Reset + " other players!",
}).setHideInfo(true).build(), new SelectFEATButton(this, "Christmas Chaos"));
}
@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");
int playerCount = 0
+ 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")
+ getPlugin().getGroupTagPlayerCount("BB")
+ getPlugin().getGroupTagPlayerCount("MB")
+ getPlugin().getGroupTagPlayerCount("EVO")
+ getPlugin().getGroupTagPlayerCount("GLD")
+ getPlugin().getGroupTagPlayerCount("BL");
_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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + C.Bold + C.cGreen + "Super Spleef",
C.Reset + "Runner",
@ -310,7 +316,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + C.Bold + C.cGreen + "Runner",
@ -331,7 +337,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -352,7 +358,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -373,7 +379,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -394,7 +400,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -415,7 +421,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -436,7 +442,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -457,7 +463,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -478,7 +484,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -499,7 +505,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
.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 + "Play all of these fun minigames and more!",
C.Reset + "",
C.Reset + "Super Spleef",
C.Reset + "Runner",
@ -520,26 +526,37 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
private void createSuperSmashCycle()
{
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!",
};
{
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());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 0).setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 1).setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 2).setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_LavaSlime").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Golem").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Enderman").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Cow").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Chicken").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Blaze").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Squid").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Spider").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Slime").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Sheep").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setPlayerHead("MHF_Pig").setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4).setTitle(C.cYellowB + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc).setHideInfo(true).build());
}
public void Update()
{
_ssmIndex++;
_minigameIndex++;
_extraValue = !_extraValue;
if (_ssmIndex >= _superSmashCycle.size())
_ssmIndex = 0;
@ -565,6 +582,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
getPlugin().getDominateShop().attemptShopOpen(player);
}
public void openCtf(Player player)
{
getPlugin().getCtfShop().attemptShopOpen(player);
}
public void openCS(Player player)
{
getPlugin().getCastleSiegeShop().attemptShopOpen(player);
@ -614,6 +636,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
getPlugin().getBetaShop().attemptShopOpen(player);
}
public void openFeatured(Player player, String name)
{
getPlugin().getShop(name).attemptShopOpen(player);
}
public void openUHC(Player player)
{
@ -629,4 +656,14 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{
getPlugin().getPlayerGamesShop().attemptShopOpen(player);
}
public void openClans(Player player)
{
getPlugin().getClansShop().attemptShopOpen(player);
}
public void openTypeWars(Player player)
{
getPlugin().getTypeWarsShop().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 SelectCLANSButton implements IButton
{
private ServerGameMenu _menu;
public SelectCLANSButton(ServerGameMenu menu)
{
_menu = menu;
}
@Override
public void onClick(Player player, ClickType clickType)
{
_menu.openClans(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 SelectCTFButton implements IButton
{
private ServerGameMenu _menu;
public SelectCTFButton(ServerGameMenu menu)
{
_menu = menu;
}
@Override
public void onClick(Player player, ClickType clickType)
{
_menu.openCtf(player);
}
}

View File

@ -0,0 +1,25 @@
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 SelectFEATButton implements IButton
{
private ServerGameMenu _menu;
private String _name;
public SelectFEATButton(ServerGameMenu menu, String name)
{
_menu = menu;
_name = name;
}
@Override
public void onClick(Player player, ClickType clickType)
{
_menu.openFeatured(player, _name);
}
}

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 SelectTWButton implements IButton
{
private ServerGameMenu _menu;
public SelectTWButton(ServerGameMenu menu)
{
_menu = menu;
}
@Override
public void onClick(Player player, ClickType clickType)
{
_menu.openTypeWars(player);
}
}

View File

@ -24,7 +24,7 @@ public class PasswordRepository extends RepositoryBase
public PasswordRepository(JavaPlugin plugin, String serverName)
{
super(plugin, DBPool.ACCOUNT);
super(plugin, DBPool.getAccount());
_serverName = serverName;
}