Reorganize tracks, add BotB track

This commit is contained in:
samczsun 2017-03-03 22:00:13 -05:00 committed by cnr
parent e5d2ad34eb
commit db2feeac42
33 changed files with 200 additions and 45 deletions

View File

@ -0,0 +1,33 @@
package mineplex.core.titles.tracks;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.Managers;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.titles.tracks.Track;
public class ItemizedTrack extends Track
{
private final InventoryManager _inventoryManager = Managers.require(InventoryManager.class);
public ItemizedTrack(String trackId, String shortName, String description, boolean hideIfUnowned)
{
super(trackId, shortName, description, hideIfUnowned);
}
public ItemizedTrack(String trackId, ChatColor color, String shortName, String longName, String description)
{
super(trackId, color, shortName, longName, description);
}
public ItemizedTrack(String trackId, ChatColor color, String shortName, String longName, String description, boolean hideIfUnowned)
{
super(trackId, color, shortName, longName, description, hideIfUnowned);
}
public boolean owns(Player player) {
return _inventoryManager.Get(player).getItemCount("Track " + getId()) > 0;
}
}

View File

@ -8,6 +8,27 @@ import java.util.Map;
import mineplex.core.MiniPlugin;
import mineplex.core.ReflectivelyCreateMiniPlugin;
import mineplex.core.titles.tracks.custom.DongerTrack;
import mineplex.core.titles.tracks.custom.EarlyBirdTrack;
import mineplex.core.titles.tracks.custom.HappyGaryTrack;
import mineplex.core.titles.tracks.custom.LeaderTrack;
import mineplex.core.titles.tracks.custom.SnekTrack;
import mineplex.core.titles.tracks.custom.TableFlipTrack;
import mineplex.core.titles.tracks.custom.WizardTrack;
import mineplex.core.titles.tracks.award.Bridges2017Track;
import mineplex.core.titles.tracks.standard.GemCollectorTrack;
import mineplex.core.titles.tracks.standard.HolidayCheerTrack;
import mineplex.core.titles.tracks.standard.LevelerTrack;
import mineplex.core.titles.tracks.standard.LuckyTrack;
import mineplex.core.titles.tracks.standard.MineplexMasteryTrack;
import mineplex.core.titles.tracks.standard.PartyAnimalTrack;
import mineplex.core.titles.tracks.standard.PeacefulTrack;
import mineplex.core.titles.tracks.standard.PerfectionistTrack;
import mineplex.core.titles.tracks.standard.PowerPlayTrack;
import mineplex.core.titles.tracks.standard.SweetToothTrack;
import mineplex.core.titles.tracks.standard.TreasureHunterTrack;
import mineplex.core.titles.tracks.standard.UnluckyTrack;
import mineplex.core.titles.tracks.standard.WarriorTrack;
@ReflectivelyCreateMiniPlugin
public class TrackManager extends MiniPlugin
@ -42,6 +63,9 @@ public class TrackManager extends MiniPlugin
// registerTrack(new SurvivorTrack());
registerTrack(new LevelerTrack());
registerTrack(new PerfectionistTrack());
// Awarded tracks
registerTrack(new Bridges2017Track());
}
private void registerTrack(Track track)

View File

@ -0,0 +1,31 @@
package mineplex.core.titles.tracks.award;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
import mineplex.core.titles.tracks.ItemizedTrack;
public class Bridges2017Track extends ItemizedTrack
{
public Bridges2017Track()
{
super(
"botb2017",
ChatColor.GOLD,
"BotB 2017",
"2017 Bridges Champion",
"This track is awarded to the winners of the 2017 BotB Tournament",
true);
special();
getRequirements()
.addTier(new TrackTier(
"2017 Bridges Champion",
null,
this::owns,
new TrackFormat(ChatColor.GOLD, ChatColor.GOLD)
));
}
}

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import java.util.Set;
@ -6,6 +6,10 @@ import net.md_5.bungee.api.ChatColor;
import com.google.common.collect.Sets;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class DongerTrack extends Track
{
private static final Set<String> OWNERS = Sets.newHashSet(
@ -13,7 +17,7 @@ public class DongerTrack extends Track
"a20d59d1-cfd8-4116-ac27-45d9c7eb4a97"
);
protected DongerTrack()
public DongerTrack()
{
super("donger", ChatColor.AQUA, "Donger", "Donger", "ヽ༼ຈل͜ຈ༽ノ", true);
special();

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -15,12 +15,15 @@ import com.google.common.collect.Sets;
import mineplex.core.Managers;
import mineplex.core.account.CoreClientManager;
import mineplex.core.account.ILoginProcessor;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class EarlyBirdTrack extends Track
{
private final Set<UUID> _wonEternal = Sets.newConcurrentHashSet();
protected EarlyBirdTrack()
public EarlyBirdTrack()
{
super("early-bird", ChatColor.AQUA, "Early Bird", "Early Bird", "This track is unlocked by receiving the Eternal rank from chickens in the 2016 Thanksgiving Event", true);
special();

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import java.util.Set;
@ -9,12 +9,15 @@ import com.google.common.collect.Sets;
import mineplex.core.Managers;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class HappyGaryTrack extends Track
{
private final CoreClientManager _coreClientManager = Managers.require(CoreClientManager.class);
protected HappyGaryTrack()
public HappyGaryTrack()
{
super("happygary", ChatColor.GOLD, "Happy Gary", "Happy Gary", "", true);
special();

View File

@ -1,16 +1,19 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.Managers;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class LeaderTrack extends Track
{
private final CoreClientManager _coreClientManager = Managers.require(CoreClientManager.class);
protected LeaderTrack()
public LeaderTrack()
{
super("leader", ChatColor.DARK_RED, "Leader", "What's a Leader?", "also wat does dev mean", true);
special();

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import java.util.Set;
@ -6,13 +6,17 @@ import net.md_5.bungee.api.ChatColor;
import com.google.common.collect.Sets;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class SnekTrack extends Track
{
private static final Set<String> OWNERS = Sets.newHashSet(
"b86b54da-93dd-46f9-be33-27bd92aa36d7"
);
protected SnekTrack()
public SnekTrack()
{
super("snek", ChatColor.DARK_GREEN, "Snek", "Snek", "oh you have do me a frighten", true);
special();

View File

@ -1,16 +1,19 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.Managers;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class TableFlipTrack extends Track
{
private final CoreClientManager _coreClientManager = Managers.require(CoreClientManager.class);
protected TableFlipTrack()
public TableFlipTrack()
{
super("tableflip", ChatColor.AQUA, "Tableflip", "Tableflip", "(╯°□°)╯ ︵ ┻━┻", true);
special();

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.custom;
import java.util.Set;
@ -6,6 +6,10 @@ import net.md_5.bungee.api.ChatColor;
import com.google.common.collect.Sets;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
// hmu t3
public class WizardTrack extends Track
{
@ -14,7 +18,7 @@ public class WizardTrack extends Track
"2016b565-0a63-4a2d-800b-b786ac256288"
);
protected WizardTrack()
public WizardTrack()
{
super("wizard", ChatColor.DARK_PURPLE, "Wizard", "Wizard", "(ノ◕ヮ◕)ノ*:・゚✧", true);
special();

View File

@ -1,10 +1,13 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.gadget.set.SetEmerald;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class GemCollectorTrack extends Track
{

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.HashMap;
import java.util.HashSet;
@ -24,6 +24,9 @@ import mineplex.core.gadget.set.SetFreedom;
import mineplex.core.gadget.set.SetFrostLord;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetSet;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
import mineplex.core.treasure.TreasureType;
import mineplex.core.treasure.event.TreasureStartEvent;

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
@ -8,6 +8,9 @@ import mineplex.core.Managers;
import mineplex.core.achievement.AchievementCategory;
import mineplex.core.donation.DonationManager;
import mineplex.core.game.GameDisplay;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class KitCollectorTrack extends Track
{

View File

@ -1,10 +1,13 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.Managers;
import mineplex.core.achievement.Achievement;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class LevelerTrack extends Track
{

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.EnumMap;
import java.util.HashSet;
@ -14,6 +14,9 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.reward.Reward;
import mineplex.core.reward.RewardRarity;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
import mineplex.core.treasure.TreasureType;
import mineplex.core.treasure.event.TreasureStartEvent;

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
@ -7,12 +7,15 @@ import org.bukkit.entity.Player;
import mineplex.core.Managers;
import mineplex.core.game.GameDisplay;
import mineplex.core.stats.StatsManager;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class MineplexMasteryTrack extends Track
{
private final StatsManager _statsManager;
protected MineplexMasteryTrack()
public MineplexMasteryTrack()
{
super("mineplex-mastery", "Mineplex Mastery", "This track is unlocked by winning different games on Mineplex");
getRequirements()

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.HashMap;
import java.util.Map;
@ -13,6 +13,9 @@ import mineplex.core.gadget.gadgets.item.ItemFirework;
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
import mineplex.core.gadget.set.SetParty;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class PartyAnimalTrack extends Track
{

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.HashSet;
import java.util.Set;
@ -9,6 +9,9 @@ import org.bukkit.entity.Player;
import mineplex.core.gadget.set.SetMusic;
import mineplex.core.game.GameDisplay;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class PeacefulTrack extends Track
{

View File

@ -1,10 +1,14 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.Managers;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackManager;
import mineplex.core.titles.tracks.TrackTier;
public class PerfectionistTrack extends Track
{

View File

@ -1,16 +1,19 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.Managers;
import mineplex.core.bonuses.BonusManager;
import mineplex.core.powerplayclub.PowerPlayClubRepository;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class PowerPlayTrack extends Track
{
private final PowerPlayClubRepository _powerPlayClubRepository = Managers.require(BonusManager.class).getPowerPlayClubRepository();
protected PowerPlayTrack()
public PowerPlayTrack()
{
super("power-play", ChatColor.AQUA, "Power Play", "Power Play VIP", "This track is unlocked by subscribing to the Power Play Club");
getRequirements()

View File

@ -1,7 +1,11 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class SurvivorTrack extends Track
{
public SurvivorTrack()

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.HashMap;
import java.util.Map;
@ -12,6 +12,9 @@ import mineplex.core.gadget.event.PlayerConsumeMelonEvent;
import mineplex.core.gadget.gadgets.item.ItemLovePotion;
import mineplex.core.gadget.set.SetCandyCane;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class SweetToothTrack extends Track
{

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.EnumMap;
@ -7,6 +7,9 @@ import net.md_5.bungee.api.ChatColor;
import org.bukkit.event.EventHandler;
import mineplex.core.gadget.set.SetWisdom;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
import mineplex.core.treasure.TreasureType;
import mineplex.core.treasure.event.TreasureStartEvent;

View File

@ -1,4 +1,4 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import java.util.EnumMap;
import java.util.HashSet;
@ -14,6 +14,9 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.reward.Reward;
import mineplex.core.reward.RewardRarity;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
import mineplex.core.treasure.event.TreasureStartEvent;
public class UnluckyTrack extends Track

View File

@ -1,10 +1,13 @@
package mineplex.core.titles.tracks;
package mineplex.core.titles.tracks.standard;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import mineplex.core.gadget.set.SetVampire;
import mineplex.core.titles.tracks.Track;
import mineplex.core.titles.tracks.TrackFormat;
import mineplex.core.titles.tracks.TrackTier;
public class WarriorTrack extends Track
{

View File

@ -34,7 +34,7 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.packethandler.IPacketHandler;
import mineplex.core.packethandler.PacketInfo;
import mineplex.core.recharge.Recharge;
import mineplex.core.titles.tracks.HolidayCheerTrack;
import mineplex.core.titles.tracks.standard.HolidayCheerTrack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;

View File

@ -9,12 +9,11 @@ import org.bukkit.block.Chest;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import mineplex.core.Managers;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.loot.ChestLoot;
import mineplex.core.titles.tracks.LuckyTrack;
import mineplex.core.titles.tracks.UnluckyTrack;
import mineplex.core.titles.tracks.standard.LuckyTrack;
import mineplex.core.titles.tracks.standard.UnluckyTrack;
import nautilus.game.arcade.ArcadeManager;

View File

@ -10,7 +10,6 @@ import java.util.UUID;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.FireworkEffect.Type;
@ -60,8 +59,6 @@ import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.recharge.Recharge;
import mineplex.core.titles.tracks.LuckyTrack;
import mineplex.core.titles.tracks.UnluckyTrack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;

View File

@ -68,8 +68,8 @@ import mineplex.core.explosion.ExplosionEvent;
import mineplex.core.loot.ChestLoot;
import mineplex.core.loot.RandomItem;
import mineplex.core.recharge.Recharge;
import mineplex.core.titles.tracks.LuckyTrack;
import mineplex.core.titles.tracks.UnluckyTrack;
import mineplex.core.titles.tracks.standard.LuckyTrack;
import mineplex.core.titles.tracks.standard.UnluckyTrack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.combat.CombatComponent;

View File

@ -101,8 +101,8 @@ import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.loot.ChestLoot;
import mineplex.core.loot.RandomItem;
import mineplex.core.recharge.Recharge;
import mineplex.core.titles.tracks.LuckyTrack;
import mineplex.core.titles.tracks.UnluckyTrack;
import mineplex.core.titles.tracks.standard.LuckyTrack;
import mineplex.core.titles.tracks.standard.UnluckyTrack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.visibility.VisibilityManager;

View File

@ -7,7 +7,7 @@ import mineplex.core.boosters.Booster;
import mineplex.core.common.Rank;
import mineplex.core.common.currency.GlobalCurrency;
import mineplex.core.common.util.*;
import mineplex.core.titles.tracks.GemCollectorTrack;
import mineplex.core.titles.tracks.standard.GemCollectorTrack;
import mineplex.minecraft.game.core.combat.CombatComponent;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import mineplex.serverdata.Utility;

View File

@ -5,7 +5,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.titles.tracks.WarriorTrack;
import mineplex.core.titles.tracks.standard.WarriorTrack;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.game.Game;

View File

@ -6,7 +6,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import mineplex.core.titles.tracks.PeacefulTrack;
import mineplex.core.titles.tracks.standard.PeacefulTrack;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game;