From 3d4fc5fa9c5968fde0096d8c795ee7668fa8e6b9 Mon Sep 17 00:00:00 2001 From: Graphica Date: Wed, 28 Jun 2017 01:36:49 -0400 Subject: [PATCH] Add cosmetics to chests --- .../core/cosmetic/CosmeticManager.java | 26 ++- .../mineplex/core/gadget/GadgetManager.java | 163 +++++++++++------- .../mineplex/core/reward/RewardManager.java | 112 +++++++----- .../core/treasure/gui/TreasurePage.java | 66 +++++-- 4 files changed, 249 insertions(+), 118 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java index d1ae7b491..9f0552d86 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java @@ -1,5 +1,7 @@ package mineplex.core.cosmetic; +import mineplex.core.chat.Chat; +import mineplex.core.punish.Punish; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -41,19 +43,23 @@ import mineplex.core.twofactor.TwoFactorAuth; public class CosmeticManager extends MiniPlugin { private final TwoFactorAuth _twofactor = Managers.require(TwoFactorAuth.class); - private InventoryManager _inventoryManager; - private GadgetManager _gadgetManager; - private MountManager _mountManager; - private PetManager _petManager; - private TreasureManager _treasureManager; - private BoosterManager _boosterManager; + private final InventoryManager _inventoryManager; + private final GadgetManager _gadgetManager; + private final MountManager _mountManager; + private final PetManager _petManager; + private final TreasureManager _treasureManager; + private final BoosterManager _boosterManager; + private final Punish _punish; private CosmeticShop _shop; private boolean _showInterface = true; private int _interfaceSlot = 4; - public CosmeticManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, GadgetManager gadgetManager, MountManager mountManager, PetManager petManager, TreasureManager treasureManager, BoosterManager boosterManager) + public CosmeticManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, + InventoryManager inventoryManager, GadgetManager gadgetManager, MountManager mountManager, + PetManager petManager, TreasureManager treasureManager, BoosterManager boosterManager, + Punish punish) { super("Cosmetic Manager", plugin); @@ -63,6 +69,7 @@ public class CosmeticManager extends MiniPlugin _petManager = petManager; _treasureManager = treasureManager; _boosterManager = boosterManager; + _punish = punish; _shop = new CosmeticShop(this, clientManager, donationManager, _moduleName); } @@ -242,6 +249,11 @@ public class CosmeticManager extends MiniPlugin { return _boosterManager; } + + public Punish getPunishManager() + { + return _punish; + } public void displayUI(Player player) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index e0d211e34..18afeb5f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -10,7 +10,18 @@ import java.util.Set; import java.util.UUID; import java.util.function.Predicate; +import mineplex.core.common.util.banner.CountryFlag; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite; +import mineplex.core.gadget.gadgets.death.DeathMapleLeaf; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple; +import mineplex.core.gadget.gadgets.flag.FlagType; import mineplex.core.gadget.gadgets.morph.MorphBobRoss; +import mineplex.core.gadget.gadgets.particle.ParticleAuraNiceness; +import mineplex.core.gadget.gadgets.particle.ParticleCanadian; +import mineplex.core.gadget.gadgets.particle.ParticleFreedomFireworks; +import mineplex.core.gadget.gadgets.particle.ParticleStarSpangled; +import mineplex.core.gadget.set.SetCanadian; +import mineplex.core.gadget.types.FlagGadget; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -47,50 +58,50 @@ import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.event.PlayerToggleSwimEvent; import mineplex.core.gadget.event.TauntCommandEvent; -import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane; -import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid; -import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald; -import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom; -import mineplex.core.gadget.gadgets.arrowtrail.frostlord.ArrowTrailFrostLord; -import mineplex.core.gadget.gadgets.arrowtrail.halloween.ArrowTrailHalloween; -import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm; -import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic; -import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti; -import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow; -import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring; -import mineplex.core.gadget.gadgets.arrowtrail.titan.ArrowTrailTitan; -import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood; -import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCupid; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEmerald; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailConfetti; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailSpring; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailBlood; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEnchant; import mineplex.core.gadget.gadgets.balloons.BalloonItem; import mineplex.core.gadget.gadgets.balloons.BalloonType; -import mineplex.core.gadget.gadgets.death.candycane.DeathCandyCane; -import mineplex.core.gadget.gadgets.death.christmas.DeathPresentDanger; -import mineplex.core.gadget.gadgets.death.cupidslove.DeathCupidsBrokenHeart; -import mineplex.core.gadget.gadgets.death.emerald.DeathEmerald; -import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom; -import mineplex.core.gadget.gadgets.death.frostlord.DeathFrostLord; -import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm; -import mineplex.core.gadget.gadgets.death.music.DeathMusic; -import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst; -import mineplex.core.gadget.gadgets.death.shadow.DeathShadow; -import mineplex.core.gadget.gadgets.death.spring.DeathSpring; -import mineplex.core.gadget.gadgets.death.titan.DeathTitan; -import mineplex.core.gadget.gadgets.death.vampire.DeathBlood; -import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant; -import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane; -import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings; -import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald; -import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom; -import mineplex.core.gadget.gadgets.doublejump.frostlord.DoubleJumpFrostLord; -import mineplex.core.gadget.gadgets.doublejump.halloween.DoubleJumpHalloween; -import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm; -import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic; -import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker; -import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow; -import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring; -import mineplex.core.gadget.gadgets.doublejump.titan.DoubleJumpTitan; -import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood; -import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant; +import mineplex.core.gadget.gadgets.death.DeathCandyCane; +import mineplex.core.gadget.gadgets.death.DeathPresentDanger; +import mineplex.core.gadget.gadgets.death.DeathCupidsBrokenHeart; +import mineplex.core.gadget.gadgets.death.DeathEmerald; +import mineplex.core.gadget.gadgets.death.DeathFreedom; +import mineplex.core.gadget.gadgets.death.DeathFrostLord; +import mineplex.core.gadget.gadgets.death.DeathStorm; +import mineplex.core.gadget.gadgets.death.DeathMusic; +import mineplex.core.gadget.gadgets.death.DeathPinataBurst; +import mineplex.core.gadget.gadgets.death.DeathShadow; +import mineplex.core.gadget.gadgets.death.DeathSpring; +import mineplex.core.gadget.gadgets.death.DeathTitan; +import mineplex.core.gadget.gadgets.death.DeathBlood; +import mineplex.core.gadget.gadgets.death.DeathEnchant; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCupidsWings; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEmerald; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFreedom; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFirecracker; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpSpring; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEnchant; import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType; import mineplex.core.gadget.gadgets.gamemodifiers.gemhunters.GameModifierMount; import mineplex.core.gadget.gadgets.gamemodifiers.gemhunters.MountType; @@ -366,6 +377,7 @@ public class GadgetManager extends MiniPlugin addSet(new SetMusic(this)); addSet(new SetFreedom(this)); addSet(new SetSpring(this)); + addSet(new SetCanadian(this)); } private void createGadgets() @@ -459,31 +471,40 @@ public class GadgetManager extends MiniPlugin // Particles addGadget(new ParticleFoot(this)); - addGadget(new ParticleFireRings(this)); - addGadget(new ParticleFairy(this)); - addGadget(new ParticleLegend(this)); - addGadget(new ParticleFrostLord(this)); - addGadget(new ParticleTitan(this)); - addGadget(new ParticleCandyCane(this)); - addGadget(new ParticleCoalFumes(this)); - addGadget(new ParticlePartyTime(this)); - addGadget(new ParticleHeart(this)); addGadget(new ParticleEmerald(this)); - addGadget(new ParticleWingsDemons(this)); - addGadget(new ParticleEnchant(this)); addGadget(new ParticleRain(this)); addGadget(new ParticleBlood(this)); + addGadget(new ParticleEnchant(this)); addGadget(new ParticleMusic(this)); - addGadget(new ParticleWingsAngel(this)); - addGadget(new ParticleWingsInfernal(this)); - addGadget(new ParticleWingsPixie(this)); + addGadget(new ParticlePartyTime(this)); + + addGadget(new ParticleHeart(this)); + addGadget(new ParticleCandyCane(this)); + addGadget(new ParticleFrostLord(this)); + addGadget(new ParticleLegend(this)); + addGadget(new ParticleTitan(this)); addGadget(new ParticleYinYang(this)); - addGadget(new ParticleFreedom(this)); - addGadget(new ParticleChristmasTree(this)); + addGadget(new ParticleKing(this, _castleManager)); + + addGadget(new ParticleWingsPixie(this)); + addGadget(new ParticleWingsDemons(this)); + addGadget(new ParticleWingsInfernal(this)); + addGadget(new ParticleWingsAngel(this)); addGadget(new ParticleWingsLove(this)); + addGadget(new ParticleFireRings(this)); + addGadget(new ParticleFairy(this)); + + addGadget(new ParticleChristmasTree(this)); + addGadget(new ParticleCoalFumes(this)); addGadget(new ParticleSpringHalo(this)); addGadget(new ParticleWingsBee(this)); - addGadget(new ParticleKing(this, _castleManager)); + + addGadget(new ParticleFreedom(this)); + addGadget(new ParticleFreedomFireworks(this)); + addGadget(new ParticleStarSpangled(this)); + addGadget(new ParticleAuraNiceness(this)); + addGadget(new ParticleCanadian(this)); + // Arrow Trails addGadget(new ArrowTrailFrostLord(this)); @@ -500,6 +521,7 @@ public class GadgetManager extends MiniPlugin addGadget(new ArrowTrailFreedom(this)); addGadget(new ArrowTrailHalloween(this)); addGadget(new ArrowTrailSpring(this)); + addGadget(new ArrowTrailRedWhite(this)); // Death Effect addGadget(new DeathFrostLord(this)); @@ -516,6 +538,7 @@ public class GadgetManager extends MiniPlugin addGadget(new DeathFreedom(this)); addGadget(new DeathPresentDanger(this)); addGadget(new DeathSpring(this)); + addGadget(new DeathMapleLeaf(this)); // Double Jump addGadget(new DoubleJumpFrostLord(this)); @@ -532,6 +555,7 @@ public class GadgetManager extends MiniPlugin addGadget(new DoubleJumpFreedom(this)); addGadget(new DoubleJumpHalloween(this)); addGadget(new DoubleJumpSpring(this)); + addGadget(new DoubleJumpMaple(this)); // Hat for (HatType hatType : HatType.values()) @@ -625,6 +649,10 @@ public class GadgetManager extends MiniPlugin addGadget(new BlowAKissTaunt(this)); addGadget(new RainbowTaunt(this)); + // Flags + addGadget(new FlagGadget(this, FlagType.UNITED_STATES)); + addGadget(new FlagGadget(this, FlagType.CANADA)); + // Kit Selectors addGadget(new WaterWingsKitSelector(this)); addGadget(new HaloKitSelector(this)); @@ -830,6 +858,23 @@ public class GadgetManager extends MiniPlugin return null; } + public FlagGadget getFlagGadget(FlagType type) + { + for (Gadget gadget : getGadgets(GadgetType.FLAG)) + { + if(gadget instanceof FlagGadget) + { + FlagGadget flagGadget = (FlagGadget) gadget; + + if (type.equals(flagGadget.getFlagType())) + { + return flagGadget; + } + } + } + return null; + } + public BalloonGadget getBalloonGadget(BalloonType balloonType) { for (Gadget gadget : getGadgets(GadgetType.BALLOON)) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java index 5f4e5fb16..eabf8e7e4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/RewardManager.java @@ -5,6 +5,14 @@ import java.util.EnumMap; import java.util.List; import java.util.Random; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite; +import mineplex.core.gadget.gadgets.death.DeathMapleLeaf; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple; +import mineplex.core.gadget.gadgets.flag.FlagType; +import mineplex.core.gadget.gadgets.particle.ParticleAuraNiceness; +import mineplex.core.gadget.gadgets.particle.ParticleCanadian; +import mineplex.core.gadget.gadgets.particle.ParticleFreedomFireworks; +import mineplex.core.gadget.gadgets.particle.ParticleStarSpangled; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -15,46 +23,46 @@ import mineplex.core.common.Rank; import mineplex.core.common.util.banner.CountryFlag; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.arrowtrail.halloween.ArrowTrailHalloween; -import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane; -import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid; -import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald; -import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom; -import mineplex.core.gadget.gadgets.arrowtrail.frostlord.ArrowTrailFrostLord; -import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm; -import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic; -import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti; -import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow; -import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring; -import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood; -import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailHalloween; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCupid; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEmerald; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailConfetti; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailSpring; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailBlood; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEnchant; import mineplex.core.gadget.gadgets.balloons.BalloonType; -import mineplex.core.gadget.gadgets.death.candycane.DeathCandyCane; -import mineplex.core.gadget.gadgets.death.christmas.DeathPresentDanger; -import mineplex.core.gadget.gadgets.death.cupidslove.DeathCupidsBrokenHeart; -import mineplex.core.gadget.gadgets.death.emerald.DeathEmerald; -import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom; -import mineplex.core.gadget.gadgets.death.frostlord.DeathFrostLord; -import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm; -import mineplex.core.gadget.gadgets.death.music.DeathMusic; -import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst; -import mineplex.core.gadget.gadgets.death.shadow.DeathShadow; -import mineplex.core.gadget.gadgets.death.spring.DeathSpring; -import mineplex.core.gadget.gadgets.death.vampire.DeathBlood; -import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant; -import mineplex.core.gadget.gadgets.doublejump.halloween.DoubleJumpHalloween; -import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane; -import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings; -import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald; -import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom; -import mineplex.core.gadget.gadgets.doublejump.frostlord.DoubleJumpFrostLord; -import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm; -import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic; -import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker; -import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow; -import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring; -import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood; -import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant; +import mineplex.core.gadget.gadgets.death.DeathCandyCane; +import mineplex.core.gadget.gadgets.death.DeathPresentDanger; +import mineplex.core.gadget.gadgets.death.DeathCupidsBrokenHeart; +import mineplex.core.gadget.gadgets.death.DeathEmerald; +import mineplex.core.gadget.gadgets.death.DeathFreedom; +import mineplex.core.gadget.gadgets.death.DeathFrostLord; +import mineplex.core.gadget.gadgets.death.DeathStorm; +import mineplex.core.gadget.gadgets.death.DeathMusic; +import mineplex.core.gadget.gadgets.death.DeathPinataBurst; +import mineplex.core.gadget.gadgets.death.DeathShadow; +import mineplex.core.gadget.gadgets.death.DeathSpring; +import mineplex.core.gadget.gadgets.death.DeathBlood; +import mineplex.core.gadget.gadgets.death.DeathEnchant; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpHalloween; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCupidsWings; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEmerald; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFreedom; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFirecracker; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpSpring; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEnchant; import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin; import mineplex.core.gadget.gadgets.hat.HatType; import mineplex.core.gadget.gadgets.item.ItemBatGun; @@ -318,6 +326,10 @@ public class RewardManager addHat(Type.WINTER_HOLIDAY, HatType.PRESENT, rarity, 5); addHat(Type.WINTER_HOLIDAY, HatType.SNOWMAN, rarity, 5); + // FREEDOM + addGadget(Type.FREEDOM, getGadget(ArrowTrailRedWhite.class), rarity, 150); + addGadget(Type.FREEDOM, getGadget(ArrowTrailFreedom.class), rarity, 150); + // Omega items addMusicReward(Type.OMEGA, "Blocks Disc", rarity, 25); addMusicReward(Type.OMEGA, "Cat Disc", rarity, 25); @@ -484,9 +496,12 @@ public class RewardManager // FREEDOM addHat(Type.FREEDOM, HatType.UNCLE_SAM, rarity, 100); + addHat(Type.FREEDOM, HatType.AMERICA, rarity, 120); + addHat(Type.FREEDOM, HatType.CANADA, rarity, 120); addGadget(Type.FREEDOM, getGadget(DoubleJumpFreedom.class), rarity, 50); - addGadget(Type.FREEDOM, getGadget(ArrowTrailFreedom.class), rarity, 10); + addGadget(Type.FREEDOM, getGadget(DoubleJumpMaple.class), rarity, 50); addGadget(Type.FREEDOM, getGadget(DeathFreedom.class), rarity, 75); + addGadget(Type.FREEDOM, getGadget(DeathMapleLeaf.class), rarity, 75); // Omega Chest addGadget(Type.OMEGA, getGadget(DoubleJumpFreedom.class), rarity, 5); @@ -758,6 +773,12 @@ public class RewardManager addMount(Type.FREEDOM, getMount(MountFreedomHorse.class), rarity, 1); addGadget(Type.FREEDOM, getGadget(MorphUncleSam.class), rarity, 5); addGadget(Type.FREEDOM, getGadget(ParticleFreedom.class), rarity, 50); + addGadget(Type.FREEDOM, getGadget(ParticleFreedomFireworks.class), rarity, 95); + addGadget(Type.FREEDOM, getGadget(ParticleAuraNiceness.class), rarity, 40); + addGadget(Type.FREEDOM, getGadget(ParticleCanadian.class), rarity, 10); + addGadget(Type.FREEDOM, getGadget(ParticleStarSpangled.class), rarity, 10); + addFlag(Type.FREEDOM, FlagType.CANADA, rarity, 35); + addFlag(Type.FREEDOM, FlagType.UNITED_STATES, rarity, 35); // Omega items addPetReward(Type.OMEGA, PetType.VILLAGER, rarity, 1); @@ -1013,6 +1034,17 @@ public class RewardManager return addGadget(type, gadget, gadget.getDisplayName(), rarity, weight, shards); } + public UnknownPackageReward addFlag(Type type, FlagType flagType, RewardRarity rarity, int weight) + { + return addFlag(type, flagType, rarity, weight, getShards(rarity)); + } + + public UnknownPackageReward addFlag(Type type, FlagType flagType, RewardRarity rarity, int weight, int shards) + { + Gadget gadget = _gadgetManager.getFlagGadget(flagType); + return addGadget(type, gadget, gadget.getDisplayName(), rarity, weight, shards); + } + public UnknownPackageReward addBalloon(Type type, BalloonType balloonType, RewardRarity rarity, int weight) { return addBalloon(type, balloonType, rarity, weight, getShards(rarity)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java index 030e3dc1d..de56e4730 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -4,6 +4,15 @@ import java.io.File; import java.util.ArrayList; import java.util.List; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailRedWhite; +import mineplex.core.gadget.gadgets.death.DeathMapleLeaf; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMaple; +import mineplex.core.gadget.gadgets.flag.FlagType; +import mineplex.core.gadget.gadgets.hat.HatType; +import mineplex.core.gadget.gadgets.particle.ParticleAuraNiceness; +import mineplex.core.gadget.gadgets.particle.ParticleCanadian; +import mineplex.core.gadget.gadgets.particle.ParticleFreedomFireworks; +import mineplex.core.gadget.gadgets.particle.ParticleStarSpangled; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -20,9 +29,9 @@ import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilText; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom; -import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom; -import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFreedom; +import mineplex.core.gadget.gadgets.death.DeathFreedom; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFreedom; import mineplex.core.gadget.gadgets.morph.MorphUncleSam; import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom; import mineplex.core.gadget.types.Gadget; @@ -141,7 +150,7 @@ public class TreasurePage extends ShopPageBase int springCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.SPRING.getItemName()); boolean availableChristmas = false; - boolean availableFreedom = false; + boolean availableFreedom = true; boolean availableHaunted = false; boolean availableTrick = false; boolean availableThank = false; @@ -152,8 +161,8 @@ public class TreasurePage extends ShopPageBase List shardLore = new ArrayList<>(); shardLore.add(" "); - shardLore.add(C.cGray + "This seems like it might come in"); - shardLore.add(C.cGray + "handy. Maybe I can collect more!"); + shardLore.add(C.cGray + "These seem like they might come in"); + shardLore.add(C.cGray + "handy. Maybe I should collect more!"); List basicLore = new ArrayList<>(); basicLore.add(" "); @@ -254,14 +263,36 @@ public class TreasurePage extends ShopPageBase freedomLore.add(C.cGray + "carved this chest himself from the wood"); freedomLore.add(C.cGray + "of the apple tree he cut down..."); freedomLore.add(" "); - if (freedomCount > 0 && !hasAllFreedomItems(getPlayer())) - freedomLore.add(C.cGreen + "Click to Open!"); + + if (freedomCount > 0) + { + if (hasAllFreedomItems(getPlayer())) + { + freedomLore.add(C.cWhite + "You own all treasures from this chest."); + } + else + { + freedomLore.add(C.cGreen + "Click to Open!"); + } + } else { - freedomLore.add(C.cRed + "This item is no longer available!"); + if (!availableFreedom) + { + freedomLore.add(C.cRed + "This item is no longer available!"); + } + else if (hasAllFreedomItems(getPlayer())) + { + freedomLore.add(C.cWhite + "You own all treasures from this chest."); + } + else + { + freedomLore.add(ChatColor.RESET + "Purchase at: " + C.cYellow + "www.mineplex.com/shop"); + } } + freedomLore.add(" "); - freedomLore.add(ChatColor.RESET + C.cGreen + getFreedomUnlockedAmount(getPlayer()) + "/7 Unlocked"); + freedomLore.add(ChatColor.RESET + C.cGreen + getFreedomUnlockedAmount(getPlayer()) + "/18 Unlocked"); List omegaLore = new ArrayList<>(); omegaLore.add(" "); @@ -699,7 +730,7 @@ public class TreasurePage extends ShopPageBase public int getFreedomUnlockedAmount(Player player) { if (hasAllFreedomItems(player)) - return 7; + return 18; int amount = 0; Gadget[] gadgets = new Gadget[] { @@ -708,7 +739,18 @@ public class TreasurePage extends ShopPageBase _gadgetManager.getGadget(ArrowTrailFreedom.class), _gadgetManager.getGadget(DoubleJumpFreedom.class), _gadgetManager.getGadget(DeathFreedom.class), - _gadgetManager.getGadget(MorphUncleSam.class) + _gadgetManager.getGadget(MorphUncleSam.class), + _gadgetManager.getGadget(ArrowTrailRedWhite.class), + _gadgetManager.getGadget(DeathMapleLeaf.class), + _gadgetManager.getGadget(DoubleJumpMaple.class), + _gadgetManager.getGadget(ParticleAuraNiceness.class), + _gadgetManager.getGadget(ParticleCanadian.class), + _gadgetManager.getGadget(ParticleFreedomFireworks.class), + _gadgetManager.getGadget(ParticleStarSpangled.class), + _gadgetManager.getHatGadget(HatType.AMERICA), + _gadgetManager.getHatGadget(HatType.CANADA), + _gadgetManager.getFlagGadget(FlagType.CANADA), + _gadgetManager.getFlagGadget(FlagType.UNITED_STATES), }; Mount freedomMount = _gadgetManager.getMountManager().getMount("Freedom Mount"); if (freedomMount != null)