From 4a5366753996d33d5276a46d870347c55d0e2551 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 5 Dec 2015 10:22:00 +1100 Subject: [PATCH 01/51] gadget restructure converted frost lord and titan particles into 4 subcategories. --- .../core/cosmetic/CosmeticManager.java | 2 +- .../core/cosmetic/ui/page/GadgetPage.java | 4 +- .../mineplex/core/gadget/GadgetManager.java | 61 ++++------ .../core/gadget/gadgets/ItemKothSword.java | 5 - .../arrowtrail/ArrowTrailFrostLord.java | 43 +++++++ .../gadgets/arrowtrail/ArrowTrailTitan.java | 55 +++++++++ .../gadget/gadgets/death/DeathFrostLord.java | 41 +++++++ .../core/gadget/gadgets/death/DeathTitan.java | 52 +++++++++ .../doublejump/DoubleJumpFrostLord.java | 38 ++++++ .../gadgets/doublejump/DoubleJumpTitan.java | 63 ++++++++++ .../gadget/gadgets/{ => item}/ItemBatGun.java | 3 +- .../gadgets/{ => item}/ItemCoinBomb.java | 3 +- .../gadgets/{ => item}/ItemDuelingSword.java | 3 +- .../gadgets/{ => item}/ItemEtherealPearl.java | 3 +- .../gadgets/{ => item}/ItemFirework.java | 3 +- .../gadgets/{ => item}/ItemFleshHook.java | 3 +- .../gadgets/{ => item}/ItemFootball.java | 3 +- .../gadgets/{ => item}/ItemGemBomb.java | 3 +- .../gadget/gadgets/item/ItemKothSword.java | 5 + .../gadgets/{ => item}/ItemMelonLauncher.java | 3 +- .../gadgets/{ => item}/ItemPaintballGun.java | 3 +- .../gadgets/{ => item}/ItemPaintbrush.java | 3 +- .../gadget/gadgets/{ => item}/ItemTNT.java | 3 +- .../gadget/gadgets/{ => morph}/BlockForm.java | 2 +- .../gadget/gadgets/{ => morph}/MorphBat.java | 2 +- .../gadgets/{ => morph}/MorphBlaze.java | 2 +- .../gadgets/{ => morph}/MorphBlock.java | 2 +- .../gadgets/{ => morph}/MorphBunny.java | 2 +- .../gadgets/{ => morph}/MorphChicken.java | 2 +- .../gadget/gadgets/{ => morph}/MorphCow.java | 2 +- .../gadgets/{ => morph}/MorphCreeper.java | 2 +- .../gadgets/{ => morph}/MorphEnderman.java | 2 +- .../gadget/gadgets/{ => morph}/MorphGeno.java | 2 +- .../gadgets/{ => morph}/MorphNotch.java | 2 +- .../gadget/gadgets/{ => morph}/MorphPig.java | 2 +- .../gadgets/{ => morph}/MorphPumpkinKing.java | 2 +- .../gadgets/{ => morph}/MorphSlime.java | 2 +- .../gadgets/{ => morph}/MorphTitan.java | 2 +- .../gadgets/{ => morph}/MorphVillager.java | 2 +- .../gadgets/{ => morph}/MorphWither.java | 2 +- .../gadgets/{ => outfit}/OutfitRaveSuit.java | 2 +- .../gadgets/{ => outfit}/OutfitSpaceSuit.java | 2 +- .../gadgets/{ => outfit}/OutfitTeam.java | 2 +- .../{ => particle}/ParticleEnchant.java | 2 +- .../gadgets/{ => particle}/ParticleFairy.java | 2 +- .../{ => particle}/ParticleFairyData.java | 2 +- .../{ => particle}/ParticleFireRings.java | 2 +- .../gadgets/{ => particle}/ParticleFoot.java | 2 +- .../ParticleFrostLord.java} | 83 +------------ .../gadgets/{ => particle}/ParticleGreen.java | 2 +- .../gadgets/{ => particle}/ParticleHeart.java | 2 +- .../gadgets/{ => particle}/ParticleHelix.java | 2 +- .../{ => particle}/ParticleKronos.java | 2 +- .../{ => particle}/ParticleKronosData.java | 2 +- .../{ => particle}/ParticleLegend.java | 2 +- .../gadgets/{ => particle}/ParticleRain.java | 2 +- .../gadgets/{ => particle}/ParticleTitan.java | 96 +-------------- .../core/gadget/types/ArrowEffectGadget.java | 110 ++++++++++++++++++ .../core/gadget/types/DeathEffectGadget.java | 44 +++++++ .../gadget/types/DoubleJumpEffectGadget.java | 65 +++++++++++ .../core/gadget/types/GadgetType.java | 3 + .../src/mineplex/hub/modules/KothManager.java | 4 +- .../src/mineplex/hub/modules/NewsManager.java | 2 +- .../mineplex/hub/modules/SoccerManager.java | 2 +- .../mineplex/hub/modules/StackerManager.java | 2 +- .../arcade/game/games/event/EventModule.java | 2 +- .../game/arcade/managers/GameManager.java | 2 +- 67 files changed, 612 insertions(+), 272 deletions(-) delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemKothSword.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemBatGun.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemCoinBomb.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemDuelingSword.java (93%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemEtherealPearl.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemFirework.java (96%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemFleshHook.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemFootball.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemGemBomb.java (98%) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemMelonLauncher.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemPaintballGun.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemPaintbrush.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => item}/ItemTNT.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/BlockForm.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphBat.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphBlaze.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphBlock.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphBunny.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphChicken.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphCow.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphCreeper.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphEnderman.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphGeno.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphNotch.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphPig.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphPumpkinKing.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphSlime.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphTitan.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphVillager.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => morph}/MorphWither.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => outfit}/OutfitRaveSuit.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => outfit}/OutfitSpaceSuit.java (94%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => outfit}/OutfitTeam.java (99%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleEnchant.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleFairy.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleFairyData.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleFireRings.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleFoot.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ParticleBlizzard.java => particle/ParticleFrostLord.java} (57%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleGreen.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleHeart.java (95%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleHelix.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleKronos.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleKronosData.java (98%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleLegend.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleRain.java (97%) rename Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/{ => particle}/ParticleTitan.java (55%) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java index 48e7d35f2..9394628ae 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/CosmeticManager.java @@ -19,7 +19,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.OutfitTeam; +import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.inventory.InventoryManager; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 6a75916e6..cebfad6bd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -19,8 +19,8 @@ import mineplex.core.cosmetic.ui.button.ActivateGadgetButton; import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton; import mineplex.core.cosmetic.ui.button.GadgetButton; import mineplex.core.donation.DonationManager; -import mineplex.core.gadget.gadgets.MorphBlock; -import mineplex.core.gadget.gadgets.MorphNotch; +import mineplex.core.gadget.gadgets.morph.MorphBlock; +import mineplex.core.gadget.gadgets.morph.MorphNotch; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 7494e9fa6..e612c3350 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -15,44 +15,13 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.DisguiseManager; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.event.GadgetCollideEntityEvent; -import mineplex.core.gadget.gadgets.ItemBatGun; -import mineplex.core.gadget.gadgets.ItemCoinBomb; -import mineplex.core.gadget.gadgets.ItemDuelingSword; -import mineplex.core.gadget.gadgets.ItemEtherealPearl; -import mineplex.core.gadget.gadgets.ItemFirework; -import mineplex.core.gadget.gadgets.ItemFleshHook; -import mineplex.core.gadget.gadgets.ItemMelonLauncher; -import mineplex.core.gadget.gadgets.ItemPaintballGun; -import mineplex.core.gadget.gadgets.ItemPaintbrush; -import mineplex.core.gadget.gadgets.ItemTNT; -import mineplex.core.gadget.gadgets.MorphBat; -import mineplex.core.gadget.gadgets.MorphBlaze; -import mineplex.core.gadget.gadgets.MorphBlock; -import mineplex.core.gadget.gadgets.MorphBunny; -import mineplex.core.gadget.gadgets.MorphChicken; -import mineplex.core.gadget.gadgets.MorphCow; -import mineplex.core.gadget.gadgets.MorphCreeper; -import mineplex.core.gadget.gadgets.MorphEnderman; -import mineplex.core.gadget.gadgets.MorphPig; -import mineplex.core.gadget.gadgets.MorphPumpkinKing; -import mineplex.core.gadget.gadgets.MorphSlime; -import mineplex.core.gadget.gadgets.MorphTitan; -import mineplex.core.gadget.gadgets.MorphVillager; -import mineplex.core.gadget.gadgets.MorphWither; -import mineplex.core.gadget.gadgets.OutfitRaveSuit; -import mineplex.core.gadget.gadgets.OutfitSpaceSuit; -import mineplex.core.gadget.gadgets.OutfitTeam; -import mineplex.core.gadget.gadgets.ParticleBlizzard; -import mineplex.core.gadget.gadgets.ParticleEnchant; -import mineplex.core.gadget.gadgets.ParticleFairy; -import mineplex.core.gadget.gadgets.ParticleFireRings; -import mineplex.core.gadget.gadgets.ParticleFoot; -import mineplex.core.gadget.gadgets.ParticleGreen; -import mineplex.core.gadget.gadgets.ParticleHeart; -import mineplex.core.gadget.gadgets.ParticleHelix; -import mineplex.core.gadget.gadgets.ParticleLegend; -import mineplex.core.gadget.gadgets.ParticleRain; -import mineplex.core.gadget.gadgets.ParticleTitan; +import mineplex.core.gadget.gadgets.arrowtrail.*; +import mineplex.core.gadget.gadgets.death.*; +import mineplex.core.gadget.gadgets.doublejump.*; +import mineplex.core.gadget.gadgets.item.*; +import mineplex.core.gadget.gadgets.morph.*; +import mineplex.core.gadget.gadgets.outfit.*; +import mineplex.core.gadget.gadgets.particle.*; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; @@ -177,9 +146,21 @@ public class GadgetManager extends MiniPlugin addGadget(new ParticleHeart(this)); addGadget(new ParticleFairy(this)); addGadget(new ParticleLegend(this)); - addGadget(new ParticleBlizzard(this)); + addGadget(new ParticleFrostLord(this)); addGadget(new ParticleTitan(this)); - //addGadget(new ParticleKronos(this)); + + // Arrow Trails + addGadget(new ArrowTrailFrostLord(this)); + addGadget(new ArrowTrailTitan(this)); + + // Death Effect + addGadget(new DeathFrostLord(this)); + addGadget(new DeathTitan(this)); + + // Double Jump + addGadget(new DoubleJumpFrostLord(this)); + addGadget(new DoubleJumpTitan(this)); + // Music addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemKothSword.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemKothSword.java deleted file mode 100644 index 6bb5d66a0..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemKothSword.java +++ /dev/null @@ -1,5 +0,0 @@ -package mineplex.core.gadget.gadgets; - -public class ItemKothSword { - -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java new file mode 100644 index 000000000..90659d76e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java @@ -0,0 +1,43 @@ +package mineplex.core.gadget.gadgets.arrowtrail; + +import org.bukkit.Material; +import org.bukkit.entity.Arrow; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.types.ArrowEffectGadget; +import mineplex.core.gadget.GadgetManager; + +public class ArrowTrailFrostLord extends ArrowEffectGadget +{ + public ArrowTrailFrostLord(GadgetManager manager) + { + super(manager, "Frost Lord", new String[] + { + C.cWhite + "You are a mighty frost lord.", + C.cWhite + "Your double jumps and arrows", + C.cWhite + "are enchanted with snow powers.", + " ", + C.cPurple + "No longer available", + }, + -1, + Material.SNOW_BALL, (byte)0); + } + + @Override + public void doTrail(Arrow arrow) + { + UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1, + ViewDist.LONGER, UtilServer.getPlayers()); + } + + @Override + public void doHitEffect(Arrow arrow) + { + UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0.4f, 12, + ViewDist.LONGER, UtilServer.getPlayers()); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java new file mode 100644 index 000000000..534d7f3b0 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java @@ -0,0 +1,55 @@ +package mineplex.core.gadget.gadgets.arrowtrail; + +import org.bukkit.Material; +import org.bukkit.entity.Arrow; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; + +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.ArrowEffectGadget; + +public class ArrowTrailTitan extends ArrowEffectGadget +{ + public ArrowTrailTitan(GadgetManager manager) + { + super(manager, "Arrows of the Titans", new String[] + { + C.cWhite + "These flames are said to be the", + C.cWhite + "souls of a lost civilisation of", + C.cWhite + "Titans, forgotten by time.", + " ", + C.cRed + "Unlocked with Titan Rank", + }, + -3, + Material.FIREBALL, (byte)0); + } + + @Override + public void doTrail(Arrow arrow) + { + UtilParticle.PlayParticle(ParticleType.FLAME, arrow.getLocation(), 0f, 0f, 0f, 0f, 1, + ViewDist.LONGER, UtilServer.getPlayers()); + } + + @Override + public void doHitEffect(Arrow arrow) + { + UtilParticle.PlayParticle(ParticleType.LAVA, arrow.getLocation(), 0f, 0f, 0f, 0f, 24, + ViewDist.LONGER, UtilServer.getPlayers()); + } + + @EventHandler + public void titanOwner(PlayerJoinEvent event) + { + if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN)) + { + Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); + } + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java new file mode 100644 index 000000000..a0ec45f09 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java @@ -0,0 +1,41 @@ +package mineplex.core.gadget.gadgets.death; + +import org.bukkit.Material; +import org.bukkit.event.EventHandler; + +import mineplex.core.blood.BloodEvent; +import mineplex.core.common.util.C; +import mineplex.core.gadget.types.DeathEffectGadget; +import mineplex.core.gadget.GadgetManager; + +public class DeathFrostLord extends DeathEffectGadget +{ + public DeathFrostLord(GadgetManager manager) + { + super(manager, "Frost Lord", new String[] + { + C.cWhite + "You are a mighty frost lord.", + C.cWhite + "Your double jumps and arrows", + C.cWhite + "are enchanted with snow powers.", + " ", + C.cPurple + "No longer available", + }, + -1, + Material.SNOW_BALL, (byte)0); + } + + @EventHandler + public void death(BloodEvent event) + { + if (event.getPlayer() == null) + return; + + if (!IsActive(event.getPlayer())) + return; + + if (!shouldDisplay(event.getPlayer())) + return; + + event.setItem(Material.SNOW_BALL, (byte)0); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java new file mode 100644 index 000000000..e7f205cf6 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java @@ -0,0 +1,52 @@ +package mineplex.core.gadget.gadgets.death; + +import org.bukkit.Material; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; + +import mineplex.core.blood.BloodEvent; +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.DeathEffectGadget; + +public class DeathTitan extends DeathEffectGadget +{ + public DeathTitan(GadgetManager manager) + { + super(manager, "Ashes of the Titans", new String[] + { + C.cWhite + "These flames are said to be the", + C.cWhite + "souls of a lost civilisation of", + C.cWhite + "Titans, forgotten by time.", + " ", + C.cRed + "Unlocked with Titan Rank", + }, + -3, + Material.FIREBALL, (byte)0); + } + + @EventHandler + public void death(BloodEvent event) + { + if (event.getPlayer() == null) + return; + + if (!IsActive(event.getPlayer())) + return; + + if (!shouldDisplay(event.getPlayer())) + return; + + event.setItem(Material.FIREBALL, (byte)0); + } + + @EventHandler + public void titanOwner(PlayerJoinEvent event) + { + if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN)) + { + Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); + } + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java new file mode 100644 index 000000000..9c7cdc726 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java @@ -0,0 +1,38 @@ +package mineplex.core.gadget.gadgets.doublejump; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerToggleFlightEvent; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.types.DoubleJumpEffectGadget; +import mineplex.core.gadget.GadgetManager; + +public class DoubleJumpFrostLord extends DoubleJumpEffectGadget +{ + public DoubleJumpFrostLord(GadgetManager manager) + { + super(manager, "Frost Lord", new String[] + { + C.cWhite + "You are a mighty frost lord.", + C.cWhite + "Your double jumps and arrows", + C.cWhite + "are enchanted with snow powers.", + " ", + C.cPurple + "No longer available", + }, + -1, + Material.SNOW_BALL, (byte)0); + } + + @Override + public void doEffect(Player player) + { + UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation(), 0f, 0f, 0f, 0.6f, 100, + ViewDist.LONGER, UtilServer.getPlayers()); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java new file mode 100644 index 000000000..f0ecce644 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -0,0 +1,63 @@ +package mineplex.core.gadget.gadgets.doublejump; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerToggleFlightEvent; + +import mineplex.core.common.Rank; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.DoubleJumpEffectGadget; + +public class DoubleJumpTitan extends DoubleJumpEffectGadget +{ + public DoubleJumpTitan(GadgetManager manager) + { + super(manager, "Leap of the Titans", new String[] + { + C.cWhite + "These flames are said to be the", + C.cWhite + "souls of a lost civilisation of", + C.cWhite + "Titans, forgotten by time.", + " ", + C.cRed + "Unlocked with Titan Rank", + }, + -3, + Material.FIREBALL, (byte)0); + } + + @Override + public void doEffect(Player player) + { + UtilParticle.PlayParticle(ParticleType.LAVA, player.getLocation(), 0f, 0f, 0f, 0.2f, 40, + ViewDist.NORMAL, UtilServer.getPlayers()); + } + + @EventHandler + public void jump(PlayerToggleFlightEvent event) + { + if (!shouldDisplay(event.getPlayer())) + return; + + if (!event.getPlayer().isFlying()) + if (IsActive(event.getPlayer())) + { + UtilParticle.PlayParticle(ParticleType.LAVA, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.2f, 40, + ViewDist.NORMAL, UtilServer.getPlayers()); + } + } + + @EventHandler + public void titanOwner(PlayerJoinEvent event) + { + if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN)) + { + Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName()); + } + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemBatGun.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemBatGun.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java index 990221e3c..8cfcae673 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemBatGun.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.ArrayList; import java.util.HashMap; @@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemCoinBomb.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemCoinBomb.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java index ce4f2e781..e68345215 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemCoinBomb.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.HashMap; import java.util.HashSet; @@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemDuelingSword.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java similarity index 93% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemDuelingSword.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java index 94d4bfea3..07456110c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemDuelingSword.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -7,6 +7,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java index bb7ef9c8f..2c07ba486 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.ArrayList; import java.util.HashSet; @@ -24,6 +24,7 @@ import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFirework.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java similarity index 96% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFirework.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java index 114fbeeff..0462dd311 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFirework.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import org.bukkit.Color; import org.bukkit.FireworkEffect; @@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.recharge.Recharge; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java index a439aca63..e4bd3554a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFleshHook.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import org.bukkit.EntityEffect; import org.bukkit.Material; @@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFootball.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFootball.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFootball.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFootball.java index 12537a599..b44dfd504 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemFootball.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFootball.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.HashSet; @@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemGemBomb.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemGemBomb.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java index 0c2e75b77..0510dbf11 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemGemBomb.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.ArrayList; import java.util.Arrays; @@ -36,6 +36,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java new file mode 100644 index 000000000..6c694ba4c --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java @@ -0,0 +1,5 @@ +package mineplex.core.gadget.gadgets.item; + +public class ItemKothSword { + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java index 0692aa661..ebe4d779e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemMelonLauncher.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.ArrayList; import java.util.Iterator; @@ -25,6 +25,7 @@ import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintballGun.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintballGun.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java index 68fba27a0..ce6f5d28e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintballGun.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.ArrayList; import java.util.HashSet; @@ -29,6 +29,7 @@ import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetBlockEvent; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java index ba0fd0d76..93070d3ad 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemPaintbrush.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.ArrayList; import java.util.Arrays; @@ -27,6 +27,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemTNT.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemTNT.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java index 0bf3531b7..0bf4a04d3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemTNT.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.item; import java.util.HashMap; import java.util.HashSet; @@ -20,6 +20,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/BlockForm.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/BlockForm.java index 7fb434ae2..4a4be4ccd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/BlockForm.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.ArrayList; import java.util.List; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java index 22cf5855e..77e253f93 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.EntityEffect; import org.bukkit.GameMode; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlaze.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlaze.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java index d7b73309d..67afa8bcb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlaze.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java index dd5e22071..208618c10 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java index 78e502bc5..056f1e33a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.HashMap; import java.util.HashSet; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphChicken.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java index 6e3be5fce..dcf03e51c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.ChatColor; import org.bukkit.EntityEffect; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphCow.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphCow.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java index 96dcda738..f16a35bce 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphCow.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.Material; import org.bukkit.Sound; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphCreeper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphCreeper.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java index 8c9419476..d2d5b0954 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphCreeper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphEnderman.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java index 72c6518d6..e6341e98b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.Color; import org.bukkit.Effect; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphGeno.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphGeno.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java index 628531f40..0eb48894d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphGeno.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphNotch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphNotch.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java index a262c149e..7671cd11c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphNotch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java index d42b43023..5a44e8322 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.HashSet; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPumpkinKing.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPumpkinKing.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java index 13c83e5d9..1e155f20c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphPumpkinKing.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.Bukkit; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphSlime.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java index 4737cf7ad..6813bbcb3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import org.bukkit.Material; import org.bukkit.Sound; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java index ed61f6511..1e36b454e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.HashMap; import java.util.HashSet; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java index 985247b53..def1ee383 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.HashSet; import java.util.Iterator; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java index 506ffc717..1d2bde3bb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.morph; import java.util.ArrayList; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitRaveSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitRaveSuit.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java index 2834498a4..cd43be616 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitRaveSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.outfit; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitSpaceSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java similarity index 94% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitSpaceSuit.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java index fe25b7843..c634500b2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitSpaceSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.outfit; import org.bukkit.ChatColor; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java similarity index 99% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java index 9090eb81e..c994f299c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/OutfitTeam.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.outfit; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleEnchant.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleEnchant.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java index 1225728a4..38a505914 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleEnchant.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.GameMode; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFairy.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFairy.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java index 2c6c70091..742355fe0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFairy.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFairyData.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairyData.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFairyData.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairyData.java index 00d4cd895..424f61382 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFairyData.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairyData.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFireRings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFireRings.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java index 3537558d2..ba639675a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFireRings.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.GameMode; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFoot.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFoot.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java index 1e68a3d93..e156de492 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleFoot.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import java.util.HashMap; import java.util.Iterator; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java similarity index 57% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index b6f57d15b..1b0c142f8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleBlizzard.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import java.util.HashSet; import java.util.Iterator; @@ -24,11 +24,11 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.core.gadget.GadgetManager; -public class ParticleBlizzard extends ParticleGadget +public class ParticleFrostLord extends ParticleGadget { private HashSet _arrows = new HashSet(); - public ParticleBlizzard(GadgetManager manager) + public ParticleFrostLord(GadgetManager manager) { super(manager, "Frost Lord", new String[] { @@ -84,81 +84,4 @@ public class ParticleBlizzard extends ParticleGadget } } } - - @EventHandler - public void jump(PlayerToggleFlightEvent event) - { - if (!shouldDisplay(event.getPlayer())) - return; - - if (!event.getPlayer().isFlying()) - if (IsActive(event.getPlayer())) - UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.6f, 100, - ViewDist.LONGER, UtilServer.getPlayers()); - } - - @EventHandler - public void arrow(ProjectileLaunchEvent event) - { - if (Manager.hideParticles()) - return; - - if (event.getEntity() instanceof Arrow) - { - if (event.getEntity().getShooter() != null) - { - if (GetActive().contains(event.getEntity().getShooter())) - { - _arrows.add((Arrow)event.getEntity()); - } - } - } - } - - @EventHandler - public void arrow(ProjectileHitEvent event) - { - if (!_arrows.remove(event.getEntity())) - return; - - UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, event.getEntity().getLocation(), 0f, 0f, 0f, 0.4f, 12, - ViewDist.LONGER, UtilServer.getPlayers()); - } - - @EventHandler - public void arrowClean(UpdateEvent event) - { - if (event.getType() != UpdateType.TICK) - return; - - for (Iterator arrowIterator = _arrows.iterator(); arrowIterator.hasNext();) - { - Arrow arrow = arrowIterator.next(); - - if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround()) - { - arrowIterator.remove(); - } - else - { - UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, arrow.getLocation(), 0f, 0f, 0f, 0f, 1, - ViewDist.LONGER, UtilServer.getPlayers()); - } - } - } - - @EventHandler - public void death(BloodEvent event) - { - if (event.getPlayer() == null) - return; - - if (!IsActive(event.getPlayer())) - return; - - if (!shouldDisplay(event.getPlayer())) - return; - - event.setItem(Material.SNOW_BALL, (byte)0); - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java index 9a370fad1..920de097b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.GameMode; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleHeart.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java similarity index 95% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleHeart.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java index 61d602440..d4160c997 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleHeart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import java.util.HashMap; import java.util.Iterator; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleHelix.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleHelix.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java index f573629ee..cc4a4882e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleHelix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.GameMode; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleKronos.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleKronos.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java index dd74addb9..02ed4ac3b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleKronos.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import java.util.HashMap; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleKronosData.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronosData.java similarity index 98% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleKronosData.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronosData.java index 5d78b2b3d..289a60099 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleKronosData.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronosData.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java index 76e4d277f..6c510f664 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.Effect; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleRain.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java similarity index 97% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleRain.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java index 4300b5369..8d6755b3c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleRain.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.GameMode; import org.bukkit.Material; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java similarity index 55% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index 9ed2bbb06..8431e6f7c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -1,24 +1,15 @@ -package mineplex.core.gadget.gadgets; - -import java.util.HashSet; -import java.util.Iterator; +package mineplex.core.gadget.gadgets.particle; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.entity.ProjectileLaunchEvent; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.util.Vector; -import mineplex.core.blood.BloodEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -28,8 +19,7 @@ import mineplex.core.updater.event.UpdateEvent; public class ParticleTitan extends ParticleGadget { - private HashSet _arrows = new HashSet(); - + private int _tick; public ParticleTitan(GadgetManager manager) @@ -112,87 +102,7 @@ public class ParticleTitan extends ParticleGadget } @EventHandler - public void jump(PlayerToggleFlightEvent event) - { - if (!shouldDisplay(event.getPlayer())) - return; - - if (!event.getPlayer().isFlying()) - if (IsActive(event.getPlayer())) - { - UtilParticle.PlayParticle(ParticleType.LAVA, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.2f, 40, - ViewDist.NORMAL, UtilServer.getPlayers()); - } - - } - - @EventHandler - public void arrow(ProjectileLaunchEvent event) - { - if (Manager.hideParticles()) - return; - - if (event.getEntity() instanceof Arrow) - { - if (event.getEntity().getShooter() != null) - { - if (GetActive().contains(event.getEntity().getShooter())) - { - _arrows.add((Arrow)event.getEntity()); - } - } - } - } - - @EventHandler - public void arrow(ProjectileHitEvent event) - { - if (!_arrows.remove(event.getEntity())) - return; - - UtilParticle.PlayParticle(ParticleType.LAVA, event.getEntity().getLocation(), 0f, 0f, 0f, 0f, 24, - ViewDist.LONGER, UtilServer.getPlayers()); - } - - @EventHandler - public void arrowClean(UpdateEvent event) - { - if (event.getType() != UpdateType.TICK) - return; - - for (Iterator arrowIterator = _arrows.iterator(); arrowIterator.hasNext();) - { - Arrow arrow = arrowIterator.next(); - - if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround()) - { - arrowIterator.remove(); - } - else - { - UtilParticle.PlayParticle(ParticleType.FLAME, arrow.getLocation(), 0f, 0f, 0f, 0f, 1, - ViewDist.LONGER, UtilServer.getPlayers()); - } - } - } - - @EventHandler - public void death(BloodEvent event) - { - if (event.getPlayer() == null) - return; - - if (!IsActive(event.getPlayer())) - return; - - if (!shouldDisplay(event.getPlayer())) - return; - - event.setItem(Material.FIREBALL, (byte)0); - } - - @EventHandler - public void legendOwner(PlayerJoinEvent event) + public void titanOwner(PlayerJoinEvent event) { if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java new file mode 100644 index 000000000..de0705c04 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java @@ -0,0 +1,110 @@ +package mineplex.core.gadget.types; + +import java.util.HashSet; +import java.util.Iterator; + +import org.bukkit.Material; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.entity.ProjectileLaunchEvent; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public abstract class ArrowEffectGadget extends Gadget +{ + protected HashSet _arrows = new HashSet(); + + public ArrowEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + { + super(manager, GadgetType.ArrowTrail, name, desc, cost, mat, data); + } + + @Override + public void EnableCustom(Player player) + { + Manager.RemoveParticle(player); + + _active.add(player); + + UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(GetName()) + ".")); + } + + @Override + public void DisableCustom(Player player) + { + if (_active.remove(player)) + UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(GetName()) + ".")); + } + + public boolean shouldDisplay(Player player) + { + if (UtilPlayer.isSpectator(player)) + return false; + + if (Manager.hideParticles()) + return false; + + return true; + } + + @EventHandler + public void arrowLaunch(ProjectileLaunchEvent event) + { + if (Manager.hideParticles()) + return; + + if (event.getEntity() instanceof Arrow) + { + if (event.getEntity().getShooter() != null) + { + if (GetActive().contains(event.getEntity().getShooter())) + { + _arrows.add((Arrow)event.getEntity()); + } + } + } + } + + @EventHandler + public void clean(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + for (Iterator arrowIterator = _arrows.iterator(); arrowIterator.hasNext();) + { + Arrow arrow = arrowIterator.next(); + + if (arrow.isDead() || !arrow.isValid() || arrow.isOnGround()) + { + arrowIterator.remove(); + } + else + { + doTrail(arrow); + } + } + } + + @EventHandler + public void arrowHit(ProjectileHitEvent event) + { + if (!_arrows.remove(event.getEntity())) + return; + + doHitEffect((Arrow)event.getEntity()); + } + + public abstract void doTrail(Arrow arrow); + public abstract void doHitEffect(Arrow arrow); +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java new file mode 100644 index 000000000..fe5b96f0f --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java @@ -0,0 +1,44 @@ +package mineplex.core.gadget.types; + +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.gadget.GadgetManager; + +public abstract class DeathEffectGadget extends Gadget +{ + public DeathEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + { + super(manager, GadgetType.Death, name, desc, cost, mat, data); + } + + @Override + public void EnableCustom(Player player) + { + Manager.RemoveParticle(player); + + _active.add(player); + + UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(GetName()) + ".")); + } + + @Override + public void DisableCustom(Player player) + { + if (_active.remove(player)) + UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(GetName()) + ".")); + } + + public boolean shouldDisplay(Player player) + { + if (UtilPlayer.isSpectator(player)) + return false; + + if (Manager.hideParticles()) + return false; + + return true; + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java new file mode 100644 index 000000000..a9e3ecfbf --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java @@ -0,0 +1,65 @@ +package mineplex.core.gadget.types; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerToggleFlightEvent; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; + +public abstract class DoubleJumpEffectGadget extends Gadget +{ + public DoubleJumpEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + { + super(manager, GadgetType.DoubleJump, name, desc, cost, mat, data); + } + + @Override + public void EnableCustom(Player player) + { + Manager.RemoveParticle(player); + + _active.add(player); + + UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(GetName()) + ".")); + } + + @Override + public void DisableCustom(Player player) + { + if (_active.remove(player)) + UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(GetName()) + ".")); + } + + public boolean shouldDisplay(Player player) + { + if (UtilPlayer.isSpectator(player)) + return false; + + if (Manager.hideParticles()) + return false; + + return true; + } + + @EventHandler + public void jump(PlayerToggleFlightEvent event) + { + if (!shouldDisplay(event.getPlayer())) + return; + + if (!event.getPlayer().isFlying()) + if (IsActive(event.getPlayer())) + { + doEffect(event.getPlayer()); + } + } + + public abstract void doEffect(Player player); +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java index 11b014b32..22de296e7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java @@ -7,4 +7,7 @@ public enum GadgetType Particle, MusicDisc, Costume, + DoubleJump, + ArrowTrail, + Death } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java index 373bb1e5d..6f69a5782 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java @@ -23,8 +23,8 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetActivateEvent; -import mineplex.core.gadget.gadgets.ItemDuelingSword; -import mineplex.core.gadget.gadgets.OutfitTeam; +import mineplex.core.gadget.gadgets.item.ItemDuelingSword; +import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.mount.event.MountActivateEvent; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java index 943acdd63..977bada57 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/NewsManager.java @@ -15,7 +15,7 @@ import mineplex.core.common.util.UtilTextTop; import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseWither; -import mineplex.core.gadget.gadgets.MorphWither; +import mineplex.core.gadget.gadgets.morph.MorphWither; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.mount.Mount; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index 1d55d9f03..687bf534c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -42,7 +42,7 @@ import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetActivateEvent; -import mineplex.core.gadget.gadgets.OutfitTeam; +import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.mount.event.MountActivateEvent; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java index bf5b654ea..0fa87552c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/StackerManager.java @@ -28,7 +28,7 @@ import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilPlayer; import mineplex.core.event.StackerEvent; -import mineplex.core.gadget.gadgets.MorphBlock; +import mineplex.core.gadget.gadgets.morph.MorphBlock; import mineplex.core.gadget.types.GadgetType; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileManager; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java index dd31d4703..b38a8f6af 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventModule.java @@ -20,7 +20,7 @@ import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.creature.event.CreatureKillEntitiesEvent; import mineplex.core.event.StackerEvent; -import mineplex.core.gadget.gadgets.MorphBlock; +import mineplex.core.gadget.gadgets.morph.MorphBlock; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.give.Give; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 7f65cc868..dd35974de 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -16,7 +16,7 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseLiving; import mineplex.core.disguise.disguises.DisguiseWither; -import mineplex.core.gadget.gadgets.MorphWither; +import mineplex.core.gadget.gadgets.morph.MorphWither; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.minecraft.game.core.condition.Condition.ConditionType; From 49c735e43cdb8c3c269bc1bc200e2c4821c67b86 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sat, 5 Dec 2015 10:34:06 +1100 Subject: [PATCH 02/51] removed duplicate code --- .../gadget/gadgets/doublejump/DoubleJumpTitan.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java index f0ecce644..618c8eff3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -38,20 +38,6 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget ViewDist.NORMAL, UtilServer.getPlayers()); } - @EventHandler - public void jump(PlayerToggleFlightEvent event) - { - if (!shouldDisplay(event.getPlayer())) - return; - - if (!event.getPlayer().isFlying()) - if (IsActive(event.getPlayer())) - { - UtilParticle.PlayParticle(ParticleType.LAVA, event.getPlayer().getLocation(), 0f, 0f, 0f, 0.2f, 40, - ViewDist.NORMAL, UtilServer.getPlayers()); - } - } - @EventHandler public void titanOwner(PlayerJoinEvent event) { From c36182b8d4403f648eb2b9bd72a985f4b9b18fac Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Mon, 7 Dec 2015 02:53:14 +0100 Subject: [PATCH 03/51] Cosmetic Update New: + New GUI System + Candy Cane Particle + Candy Cane Double Jump + Candy Cane Death Effect + Candy Cane Arrow Trail + Snowman Morph + Baby Reindeer Mount + Pet Coal Apparition Fixed/Updated: * Added getTick to UpdateEvent and UtilTime * Added more methods to UtilParticle * Gadget manager isMoving now counts flying as moving * Updated some cosmetics --- .../core/common/util/UtilParticle.java | 13 ++ .../mineplex/core/common/util/UtilTime.java | 11 ++ .../cosmetic/ui/button/OpenArrowTrails.java | 23 +++ .../ui/button/OpenDeathAnimations.java | 23 +++ .../cosmetic/ui/button/OpenDoubleJump.java | 23 +++ .../core/cosmetic/ui/button/OpenHats.java | 23 +++ .../core/cosmetic/ui/page/ArrowTrailPage.java | 53 +++++++ .../cosmetic/ui/page/DeathEffectPage.java | 53 +++++++ .../core/cosmetic/ui/page/DoubleJumpPage.java | 53 +++++++ .../core/cosmetic/ui/page/HatPage.java | 57 ++++++++ .../mineplex/core/cosmetic/ui/page/Menu.java | 133 ++++++++++-------- .../core/cosmetic/ui/page/MorphPage.java | 2 + .../core/cosmetic/ui/page/TauntPage.java | 57 ++++++++ .../mineplex/core/gadget/GadgetManager.java | 132 ++++++++++++----- .../arrowtrail/ArrowTrailCandyCane.java | 48 +++++++ .../arrowtrail/ArrowTrailFrostLord.java | 6 +- .../gadget/gadgets/death/DeathCandyCane.java | 49 +++++++ .../gadget/gadgets/death/DeathFrostLord.java | 6 +- .../doublejump/DoubleJumpCandyCane.java | 36 +++++ .../doublejump/DoubleJumpFrostLord.java | 10 +- .../gadgets/doublejump/DoubleJumpTitan.java | 1 + .../gadget/gadgets/item/ItemDuelingSword.java | 3 +- .../gadget/gadgets/item/ItemPaintbrush.java | 3 +- .../gadget/gadgets/morph/MorphSnowman.java | 127 +++++++++++++++++ .../gadget/gadgets/outfit/OutfitTeam.java | 3 +- .../gadgets/particle/ParticleCandyCane.java | 93 ++++++++++++ .../gadgets/particle/ParticleFrostLord.java | 6 +- .../core/gadget/types/ArrowEffectGadget.java | 6 +- .../core/gadget/types/DeathEffectGadget.java | 2 +- .../gadget/types/DoubleJumpEffectGadget.java | 2 +- .../core/gadget/types/GadgetType.java | 4 +- .../core/gadget/types/ItemGadget.java | 4 +- .../core/gadget/types/MorphGadget.java | 2 +- .../core/gadget/types/OutfitGadget.java | 2 +- .../core/gadget/types/ParticleGadget.java | 3 +- .../src/mineplex/core/mount/MountManager.java | 2 + .../core/mount/types/MountBabyReindeer.java | 92 ++++++++++++ .../mineplex/core/mount/types/MountTitan.java | 6 + .../src/mineplex/core/pet/PetFactory.java | 16 +-- .../src/mineplex/core/pet/PetManager.java | 99 ++++++++----- .../core/pet/types/PetCoalApparition.java | 14 ++ .../core/updater/event/UpdateEvent.java | 6 + .../game/arcade/command/DisguiseCommand.java | 2 +- 43 files changed, 1132 insertions(+), 177 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/ArrowTrailPage.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DeathEffectPage.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DoubleJumpPage.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java index d7896c943..bacca401f 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java @@ -283,4 +283,17 @@ public class UtilParticle UtilPlayer.sendPacket(player, packet); } } + + public static void PlayParticleToAll(String particle, Location location, Vector offset, float speed, int count, ViewDist dist) + { + PlayParticle(particle, location, (float) offset.getX(), (float) offset.getY(), (float) offset.getZ(), speed, count, dist, UtilServer.getPlayers()); + } + + public static void PlayParticleToAll(String particle, Location location, float offsetX, float offsetY, float offsetZ, + float speed, int count, ViewDist dist) + { + PlayParticle(particle, location, offsetX, offsetY, offsetZ, speed, count, dist, UtilServer.getPlayers()); + } + + } \ No newline at end of file diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java index 908272bc6..5d5174f16 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilTime.java @@ -3,6 +3,8 @@ package mineplex.core.common.util; import java.text.SimpleDateFormat; import java.util.Calendar; +import net.minecraft.server.v1_8_R3.MinecraftServer; + public class UtilTime { public static final String DATE_FORMAT_NOW = "MM-dd-yyyy HH:mm:ss"; @@ -41,6 +43,15 @@ public class UtilTime default: return "th"; } } + + /** + * + * @return Returns the current global server tick. Is reset on server restart. Starts out negative. Counts upwards. + */ + public static int getServerTick() + { + return MinecraftServer.currentTick; + } public enum TimeUnit { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java new file mode 100644 index 000000000..2664fb9c7 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenArrowTrails.java @@ -0,0 +1,23 @@ +package mineplex.core.cosmetic.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.cosmetic.ui.page.ArrowTrailPage; +import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.shop.item.IButton; + +public class OpenArrowTrails implements IButton +{ + private Menu _page; + + public OpenArrowTrails(Menu page) + { + _page = page; + } + + public void onClick(Player player, ClickType clickType) + { + _page.getShop().openPageForPlayer(player, new ArrowTrailPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Arrow Trails", player)); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java new file mode 100644 index 000000000..fad54be30 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDeathAnimations.java @@ -0,0 +1,23 @@ +package mineplex.core.cosmetic.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.cosmetic.ui.page.DeathEffectPage; +import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.shop.item.IButton; + +public class OpenDeathAnimations implements IButton +{ + private Menu _page; + + public OpenDeathAnimations(Menu page) + { + _page = page; + } + + public void onClick(Player player, ClickType clickType) + { + _page.getShop().openPageForPlayer(player, new DeathEffectPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Death Animations", player)); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java new file mode 100644 index 000000000..b433181c8 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenDoubleJump.java @@ -0,0 +1,23 @@ +package mineplex.core.cosmetic.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.cosmetic.ui.page.DoubleJumpPage; +import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.shop.item.IButton; + +public class OpenDoubleJump implements IButton +{ + private Menu _page; + + public OpenDoubleJump(Menu page) + { + _page = page; + } + + public void onClick(Player player, ClickType clickType) + { + _page.getShop().openPageForPlayer(player, new DoubleJumpPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Double Jump Effects", player)); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java new file mode 100644 index 000000000..48cd8a98c --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/button/OpenHats.java @@ -0,0 +1,23 @@ +package mineplex.core.cosmetic.ui.button; + +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.cosmetic.ui.page.HatPage; +import mineplex.core.cosmetic.ui.page.Menu; +import mineplex.core.shop.item.IButton; + +public class OpenHats implements IButton +{ + private Menu _page; + + public OpenHats(Menu page) + { + _page = page; + } + + public void onClick(Player player, ClickType clickType) + { + _page.getShop().openPageForPlayer(player, new HatPage(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), "Hats", player)); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/ArrowTrailPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/ArrowTrailPage.java new file mode 100644 index 000000000..09ee4c247 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/ArrowTrailPage.java @@ -0,0 +1,53 @@ +package mineplex.core.cosmetic.ui.page; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.shop.item.IButton; +import mineplex.core.shop.item.ShopItem; + +public class ArrowTrailPage extends GadgetPage +{ + + public ArrowTrailPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, + Player player) + { + super(plugin, shop, clientManager, donationManager, name, player); + } + + @Override + protected void buildPage() + { + int slot = 19; + + for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.ArrowTrail)) + { + addGadget(gadget, slot); + + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) + addGlow(slot); + + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + { + public void onClick(Player player, ClickType clickType) + { + getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); + } + }); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DeathEffectPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DeathEffectPage.java new file mode 100644 index 000000000..838c60806 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DeathEffectPage.java @@ -0,0 +1,53 @@ +package mineplex.core.cosmetic.ui.page; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.shop.item.IButton; +import mineplex.core.shop.item.ShopItem; + +public class DeathEffectPage extends GadgetPage +{ + + public DeathEffectPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, + String name, Player player) + { + super(plugin, shop, clientManager, donationManager, name, player); + } + + @Override + protected void buildPage() + { + int slot = 19; + + for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Death)) + { + addGadget(gadget, slot); + + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) + addGlow(slot); + + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + { + public void onClick(Player player, ClickType clickType) + { + getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); + } + }); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DoubleJumpPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DoubleJumpPage.java new file mode 100644 index 000000000..43efbee35 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/DoubleJumpPage.java @@ -0,0 +1,53 @@ +package mineplex.core.cosmetic.ui.page; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.shop.item.IButton; +import mineplex.core.shop.item.ShopItem; + +public class DoubleJumpPage extends GadgetPage +{ + + public DoubleJumpPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, + Player player) + { + super(plugin, shop, clientManager, donationManager, name, player); + } + + @Override + protected void buildPage() + { + int slot = 19; + + for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.DoubleJump)) + { + addGadget(gadget, slot); + + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) + addGlow(slot); + + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + { + public void onClick(Player player, ClickType clickType) + { + getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); + } + }); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java new file mode 100644 index 000000000..8ea9fff22 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java @@ -0,0 +1,57 @@ +package mineplex.core.cosmetic.ui.page; + +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.shop.item.IButton; +import mineplex.core.shop.item.ShopItem; + +public class HatPage extends GadgetPage +{ + + + public HatPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, + Player player) + { + super(plugin, shop, clientManager, donationManager, name, player); + } + + @Override + protected void buildPage() + { + int slot = 19; + + List list = getPlugin().getGadgetManager().getGadgets(GadgetType.Hat); + if(list != null) + for (Gadget gadget : list) + { + addGadget(gadget, slot); + + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) + addGlow(slot); + + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + { + public void onClick(Player player, ClickType clickType) + { + getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); + } + }); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index e77751779..143794f24 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -6,15 +6,19 @@ import org.bukkit.entity.Creature; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -import org.bukkit.inventory.ItemStack; import mineplex.core.account.CoreClientManager; import mineplex.core.common.CurrencyType; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.cosmetic.ui.button.OpenArrowTrails; import mineplex.core.cosmetic.ui.button.OpenCostumes; +import mineplex.core.cosmetic.ui.button.OpenDeathAnimations; +import mineplex.core.cosmetic.ui.button.OpenDoubleJump; import mineplex.core.cosmetic.ui.button.OpenGadgets; +import mineplex.core.cosmetic.ui.button.OpenHats; import mineplex.core.cosmetic.ui.button.OpenMorphs; import mineplex.core.cosmetic.ui.button.OpenMounts; import mineplex.core.cosmetic.ui.button.OpenMusic; @@ -66,67 +70,80 @@ public class Menu extends ShopPageBase ChatColor.RESET + "Receives 30000 Coins per Month" }, 1, false)); -// addItem(6, new ShopItem(Material.GOLD_INGOT, donor.getGold() + " Gold", new String[] { -// " " -// }, 1, false)); - - addButton(18, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this)); - addButton(20, new ShopItem(Material.BOW, "Gadgets", 1, false), new OpenGadgets(this)); - addButton(22, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this)); - addButton(24, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this)); - addButton(26, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this)); - // - addButton(48, new ShopItem(Material.GOLD_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); - addButton(50, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); - - if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Particle) != null) - { - final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Particle); - - addButton(18 + 9, - new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[]{}, 1, false, false), - new IButton() - { - public void onClick(Player player, ClickType clickType) - { - playAcceptSound(player); - gadget.Disable(player); - refresh(); - } - }); - } - - if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Item) != null) - { - final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Item); - - addButton(20 + 9, - new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[]{}, 1, false, false), - new IButton() - { - public void onClick(Player player, ClickType clickType) - { - playAcceptSound(player); - gadget.Disable(player); - refresh(); - } - }); - } + addButton(10, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this)); + addButton(12, new ShopItem(Material.ARROW, "Arrow Trails", 1, false), new OpenArrowTrails(this)); + addButton(14, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", 1, false), new OpenDoubleJump(this)); + addButton(16, new ShopItem(Material.SKULL_ITEM, "Death Animations", 1, false), new OpenDeathAnimations(this)); - if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) != null) + addButton(28, new ShopItem(Material.MELON_BLOCK, "Gadgets", 1, false), new OpenGadgets(this)); + addButton(30, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this)); + addButton(32, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this)); + addButton(34, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this)); + + addButton(46, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this)); + addButton(48, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); + addButton(50, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); + addButton(52, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton() { - final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph); - - addButton(22 + 9, - new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), ChatColor.RESET + C.mItem + gadget.GetName(), new String[]{}, 1, false, false), + @Override + public void onClick(Player player, ClickType clickType) + { + player.sendMessage(F.main("Shop", "Comming soon!")); + } + }); + + for(GadgetType type : GadgetType.values()) + { + final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), type); + if(gadget == null) continue; + + int slot = 10; + switch (type) + { + case Particle: + slot = 10; + break; + case ArrowTrail: + slot = 12; + break; + case DoubleJump: + slot = 14; + break; + case Death: + slot = 16; + break; + case Item: + slot = 28; + break; + case Morph: + slot = 30; + break; + case Hat: + slot = 46; + break; + case Costume: + slot = 48; + break; + case MusicDisc: + slot = 50; + break; + case Taunt: + slot = 52; + break; + default: + slot = 10; + break; + } + slot += 9; + + addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[0], 1, false, false), new IButton() { - public void onClick(Player player, ClickType clickType) - { + public void onClick(Player player, ClickType clickType) { playAcceptSound(player); gadget.Disable(player); refresh(); - } + }; }); } @@ -134,8 +151,8 @@ public class Menu extends ShopPageBase { final Mount mount = getPlugin().getMountManager().getActive(getPlayer()); - addButton(24 + 9, - new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), ChatColor.RESET + C.mItem + mount.GetName(), new String[]{}, 1, false, false), + addButton(32 + 9, + new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), C.mItem + mount.GetName(), new String[0], 1, false, false), new IButton() { public void onClick(Player player, ClickType clickType) @@ -151,7 +168,7 @@ public class Menu extends ShopPageBase { Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName()); String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName(); - addButton(26 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), ChatColor.RESET + C.mItem + petName, new String[]{}, 1, false, false), + addButton(34 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false), new IButton() { public void onClick(Player player, ClickType clickType) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MorphPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MorphPage.java index 508a58276..fb425172d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MorphPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MorphPage.java @@ -37,6 +37,8 @@ public class MorphPage extends GadgetPage if (slot == 26) slot = 28; + if (slot == 35) + slot = 37; } addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java new file mode 100644 index 000000000..93aeac8d5 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java @@ -0,0 +1,57 @@ +package mineplex.core.cosmetic.ui.page; + +import java.util.List; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; + +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.C; +import mineplex.core.cosmetic.CosmeticManager; +import mineplex.core.cosmetic.ui.CosmeticShop; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.shop.item.IButton; +import mineplex.core.shop.item.ShopItem; + +public class TauntPage extends GadgetPage +{ + + + public TauntPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, + Player player) + { + super(plugin, shop, clientManager, donationManager, name, player); + } + + @Override + protected void buildPage() + { + int slot = 19; + + List list = getPlugin().getGadgetManager().getGadgets(GadgetType.Taunt); + if(list != null) + for (Gadget gadget : list) + { + addGadget(gadget, slot); + + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) + addGlow(slot); + + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + { + public void onClick(Player player, ClickType clickType) + { + getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); + } + }); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index e612c3350..836cc0aec 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -3,39 +3,6 @@ package mineplex.core.gadget; import java.util.ArrayList; import java.util.List; -import mineplex.core.MiniPlugin; -import mineplex.core.account.CoreClientManager; -import mineplex.core.achievement.AchievementManager; -import mineplex.core.blockrestore.BlockRestore; -import mineplex.core.common.Rank; -import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.disguise.DisguiseManager; -import mineplex.core.donation.DonationManager; -import mineplex.core.gadget.event.GadgetCollideEntityEvent; -import mineplex.core.gadget.gadgets.arrowtrail.*; -import mineplex.core.gadget.gadgets.death.*; -import mineplex.core.gadget.gadgets.doublejump.*; -import mineplex.core.gadget.gadgets.item.*; -import mineplex.core.gadget.gadgets.morph.*; -import mineplex.core.gadget.gadgets.outfit.*; -import mineplex.core.gadget.gadgets.particle.*; -import mineplex.core.gadget.types.Gadget; -import mineplex.core.gadget.types.GadgetType; -import mineplex.core.gadget.types.ItemGadget; -import mineplex.core.gadget.types.MorphGadget; -import mineplex.core.gadget.types.MusicGadget; -import mineplex.core.gadget.types.OutfitGadget; -import mineplex.core.gadget.types.OutfitGadget.ArmorSlot; -import mineplex.core.gadget.types.ParticleGadget; -import mineplex.core.inventory.InventoryManager; -import mineplex.core.mount.MountManager; -import mineplex.core.pet.PetManager; -import mineplex.core.preferences.PreferencesManager; -import mineplex.core.projectile.ProjectileManager; - import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -49,6 +16,82 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerToggleSneakEvent; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClientManager; +import mineplex.core.achievement.AchievementManager; +import mineplex.core.blockrestore.BlockRestore; +import mineplex.core.common.Rank; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.disguise.DisguiseManager; +import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.event.GadgetCollideEntityEvent; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan; +import mineplex.core.gadget.gadgets.death.DeathCandyCane; +import mineplex.core.gadget.gadgets.death.DeathFrostLord; +import mineplex.core.gadget.gadgets.death.DeathTitan; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; +import mineplex.core.gadget.gadgets.item.ItemBatGun; +import mineplex.core.gadget.gadgets.item.ItemCoinBomb; +import mineplex.core.gadget.gadgets.item.ItemDuelingSword; +import mineplex.core.gadget.gadgets.item.ItemEtherealPearl; +import mineplex.core.gadget.gadgets.item.ItemFirework; +import mineplex.core.gadget.gadgets.item.ItemFleshHook; +import mineplex.core.gadget.gadgets.item.ItemMelonLauncher; +import mineplex.core.gadget.gadgets.item.ItemPaintballGun; +import mineplex.core.gadget.gadgets.item.ItemPaintbrush; +import mineplex.core.gadget.gadgets.item.ItemPartyPopper; +import mineplex.core.gadget.gadgets.item.ItemTNT; +import mineplex.core.gadget.gadgets.morph.MorphBat; +import mineplex.core.gadget.gadgets.morph.MorphBlaze; +import mineplex.core.gadget.gadgets.morph.MorphBlock; +import mineplex.core.gadget.gadgets.morph.MorphBunny; +import mineplex.core.gadget.gadgets.morph.MorphChicken; +import mineplex.core.gadget.gadgets.morph.MorphCow; +import mineplex.core.gadget.gadgets.morph.MorphCreeper; +import mineplex.core.gadget.gadgets.morph.MorphEnderman; +import mineplex.core.gadget.gadgets.morph.MorphPig; +import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing; +import mineplex.core.gadget.gadgets.morph.MorphSlime; +import mineplex.core.gadget.gadgets.morph.MorphSnowman; +import mineplex.core.gadget.gadgets.morph.MorphTitan; +import mineplex.core.gadget.gadgets.morph.MorphVillager; +import mineplex.core.gadget.gadgets.morph.MorphWither; +import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit; +import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit; +import mineplex.core.gadget.gadgets.outfit.OutfitTeam; +import mineplex.core.gadget.gadgets.particle.ParticleCandyCane; +import mineplex.core.gadget.gadgets.particle.ParticleEnchant; +import mineplex.core.gadget.gadgets.particle.ParticleFairy; +import mineplex.core.gadget.gadgets.particle.ParticleFireRings; +import mineplex.core.gadget.gadgets.particle.ParticleFoot; +import mineplex.core.gadget.gadgets.particle.ParticleFrostLord; +import mineplex.core.gadget.gadgets.particle.ParticleGreen; +import mineplex.core.gadget.gadgets.particle.ParticleHeart; +import mineplex.core.gadget.gadgets.particle.ParticleHelix; +import mineplex.core.gadget.gadgets.particle.ParticleLegend; +import mineplex.core.gadget.gadgets.particle.ParticleRain; +import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; +import mineplex.core.gadget.types.ItemGadget; +import mineplex.core.gadget.types.MusicGadget; +import mineplex.core.gadget.types.OutfitGadget; +import mineplex.core.gadget.types.OutfitGadget.ArmorSlot; +import mineplex.core.gadget.types.ParticleGadget; +import mineplex.core.inventory.InventoryManager; +import mineplex.core.mount.MountManager; +import mineplex.core.pet.PetManager; +import mineplex.core.preferences.PreferencesManager; +import mineplex.core.projectile.ProjectileManager; + public class GadgetManager extends MiniPlugin { private CoreClientManager _clientManager; @@ -103,6 +146,7 @@ public class GadgetManager extends MiniPlugin addGadget(new ItemCoinBomb(this)); addGadget(new ItemPaintbrush(this)); addGadget(new ItemDuelingSword(this)); + addGadget(new ItemPartyPopper(this)); // Costume addGadget(new OutfitRaveSuit(this, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0)); @@ -135,6 +179,7 @@ public class GadgetManager extends MiniPlugin addGadget(new MorphBunny(this)); addGadget(new MorphSlime(this, _achievementManager)); addGadget(new MorphTitan(this)); + addGadget(new MorphSnowman(this)); // Particles addGadget(new ParticleFoot(this)); @@ -148,18 +193,22 @@ public class GadgetManager extends MiniPlugin addGadget(new ParticleLegend(this)); addGadget(new ParticleFrostLord(this)); addGadget(new ParticleTitan(this)); + addGadget(new ParticleCandyCane(this)); // Arrow Trails addGadget(new ArrowTrailFrostLord(this)); addGadget(new ArrowTrailTitan(this)); + addGadget(new ArrowTrailCandyCane(this)); // Death Effect addGadget(new DeathFrostLord(this)); addGadget(new DeathTitan(this)); + addGadget(new DeathCandyCane(this)); // Double Jump addGadget(new DoubleJumpFrostLord(this)); addGadget(new DoubleJumpTitan(this)); + addGadget(new DoubleJumpCandyCane(this)); // Music @@ -207,6 +256,7 @@ public class GadgetManager extends MiniPlugin return _gadgets.get(gadgetType); } + // Disallows two armor gadgets in same slot. public void RemoveOutfit(Player player, ArmorSlot slot) { @@ -227,6 +277,7 @@ public class GadgetManager extends MiniPlugin } } + /* public void RemoveItem(Player player) { for (GadgetType gadgetType : _gadgets.keySet()) @@ -274,6 +325,17 @@ public class GadgetManager extends MiniPlugin } } } + */ + + public void removeGadetType(Player player, GadgetType type) + { + List gadgets = _gadgets.get(type); + if(gadgets == null) return; + for(Gadget g : gadgets) + { + g.Disable(player); + } + } public void DisableAll() { @@ -367,7 +429,7 @@ public class GadgetManager extends MiniPlugin @EventHandler public void setMoving(PlayerMoveEvent event) { - if (UtilMath.offset(event.getFrom(), event.getTo()) <= 0) + if (UtilMath.offset(event.getFrom(), event.getTo()) <= 0.1) return; _lastMove.put(event.getPlayer(), System.currentTimeMillis()); @@ -375,6 +437,8 @@ public class GadgetManager extends MiniPlugin public boolean isMoving(Player player) { + if (!UtilEnt.isGrounded(player)) return true; + if (!_lastMove.containsKey(player)) return false; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java new file mode 100644 index 000000000..1b9741cfe --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java @@ -0,0 +1,48 @@ +package mineplex.core.gadget.gadgets.arrowtrail; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Arrow; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilTime; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.ArrowEffectGadget; + +public class ArrowTrailCandyCane extends ArrowEffectGadget +{ + + public ArrowTrailCandyCane(GadgetManager manager) + { + super(manager, "Candy Cane Arrow Effect", new String[] + { + C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".", + }, + 1, + Material.SNOW_BALL, (byte)0); + } + + @Override + public void doTrail(Arrow arrow) + { + int data = 15; + int tick = Math.abs(UtilTime.getServerTick()%3); + if(tick == 1) data = 1; + if(tick == 2) data = 2; + Location loc = arrow.getLocation(); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), loc, 0, 0, 0, 0.0f, 1, ViewDist.NORMAL); + } + + @Override + public void doHitEffect(Arrow arrow) + { + Location loc = arrow.getLocation(); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 15), loc, 0, 0, 0, 0.1f, 20, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 1), loc, 0, 0, 0, 0.1f, 20, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 2), loc, 0, 0, 0, 0.1f, 20, ViewDist.NORMAL); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java index 90659d76e..658c25e72 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java @@ -15,15 +15,13 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget { public ArrowTrailFrostLord(GadgetManager manager) { - super(manager, "Frost Lord", new String[] + super(manager, "Frost Lord Arrow Trail", new String[] { C.cWhite + "You are a mighty frost lord.", C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", - " ", - C.cPurple + "No longer available", }, - -1, + 10, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java new file mode 100644 index 000000000..524b45244 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java @@ -0,0 +1,49 @@ +package mineplex.core.gadget.gadgets.death; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.event.EventHandler; + +import mineplex.core.blood.BloodEvent; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.types.DeathEffectGadget; +import mineplex.core.gadget.GadgetManager; + +public class DeathCandyCane extends DeathEffectGadget +{ + public DeathCandyCane(GadgetManager manager) + { + super(manager, "Candy Cane Effect", new String[] + { + C.cWhite + "COLORS FTW!", + C.cWhite + "Take damage with SWAG B)", + }, + 10, + Material.SNOW_BALL, (byte)0); + } + + @EventHandler + public void death(BloodEvent event) + { + if (event.getPlayer() == null) + return; + + if (!IsActive(event.getPlayer())) + return; + + if (!shouldDisplay(event.getPlayer())) + return; + + event.setCancelled(true); + + event.setItem(Material.INK_SACK, (byte) 15); + + Location loc = event.getLocation(); + int a = event.getParticles(); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 1), loc, 0, 0, 0, 0.1f, a, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 2), loc, 0, 0, 0, 0.1f, a, ViewDist.NORMAL); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java index a0ec45f09..91cc05ad6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java @@ -12,15 +12,13 @@ public class DeathFrostLord extends DeathEffectGadget { public DeathFrostLord(GadgetManager manager) { - super(manager, "Frost Lord", new String[] + super(manager, "Frost Lord Death Effect", new String[] { C.cWhite + "You are a mighty frost lord.", C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", - " ", - C.cPurple + "No longer available", }, - -1, + 10, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java new file mode 100644 index 000000000..090963762 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java @@ -0,0 +1,36 @@ +package mineplex.core.gadget.gadgets.doublejump; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.DoubleJumpEffectGadget; + +public class DoubleJumpCandyCane extends DoubleJumpEffectGadget +{ + + public DoubleJumpCandyCane(GadgetManager manager) + { + super(manager, "Candy Cane Jump Effect", new String[] + { + C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".", + }, + 1, + Material.SNOW_BALL, (byte)0); + } + + @Override + public void doEffect(Player player) + { + Location loc = player.getLocation(); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 15), loc, 0, 0, 0, 0.15f, 100, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 1), loc, 0, 0, 0, 0.15f, 100, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 2), loc, 0, 0, 0, 0.15f, 100, ViewDist.NORMAL); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java index 9c7cdc726..365d6d1ce 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java @@ -17,15 +17,11 @@ public class DoubleJumpFrostLord extends DoubleJumpEffectGadget { public DoubleJumpFrostLord(GadgetManager manager) { - super(manager, "Frost Lord", new String[] + super(manager, "Frost Lord Jump Effect", new String[] { - C.cWhite + "You are a mighty frost lord.", - C.cWhite + "Your double jumps and arrows", - C.cWhite + "are enchanted with snow powers.", - " ", - C.cPurple + "No longer available", + C.cWhite + "More snow incomming.", }, - -1, + 1, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java index 618c8eff3..ed418db96 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -36,6 +36,7 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget { UtilParticle.PlayParticle(ParticleType.LAVA, player.getLocation(), 0f, 0f, 0f, 0.2f, 40, ViewDist.NORMAL, UtilServer.getPlayers()); + UtilParticle.PlayParticleToAll(ParticleType.FLAME, player.getLocation(), 0, 0, 0, 0.2f, 40, ViewDist.NORMAL); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java index 07456110c..99a7d217f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java @@ -8,6 +8,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; @@ -27,7 +28,7 @@ public class ItemDuelingSword extends ItemGadget @Override public void ApplyItem(Player player, boolean inform) { - Manager.RemoveItem(player); + Manager.removeGadetType(player, GadgetType.Item); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java index 93070d3ad..a7cbba607 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java @@ -28,6 +28,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; @@ -56,7 +57,7 @@ public class ItemPaintbrush extends ItemGadget @Override public void ApplyItem(Player player, boolean inform) { - Manager.RemoveItem(player); + Manager.removeGadetType(player, GadgetType.Item); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java new file mode 100644 index 000000000..6e7d29b8e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java @@ -0,0 +1,127 @@ +package mineplex.core.gadget.gadgets.morph; + +import java.util.WeakHashMap; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; +import org.bukkit.entity.Snowball; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilMath; +import mineplex.core.disguise.disguises.DisguiseSnowman; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.event.GadgetCollideEntityEvent; +import mineplex.core.gadget.types.MorphGadget; +import mineplex.core.recharge.Recharge; +import mineplex.core.recharge.RechargeData; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class MorphSnowman extends MorphGadget +{ + + private WeakHashMap _snowball = new WeakHashMap(); + + public MorphSnowman(GadgetManager manager) + { + super(manager, "Snowman Morph", + new String[]{ C.cWhite + "Do you wanna build a snowman?", C.cWhite + "It doesn't have to be a snowman...", + C.cWhite + "Or... it kind of does...", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Snowball", }, + 6000, Material.SNOW_BALL, (byte) 0); + } + + @Override + public void EnableCustom(Player player) + { + this.ApplyArmor(player); + + DisguiseSnowman disguise = new DisguiseSnowman(player); + disguise.setName(player.getName(), Manager.getClientManager().Get(player).GetRank()); + disguise.setCustomNameVisible(true); + Manager.getDisguiseManager().disguise(disguise); + } + + @Override + public void DisableCustom(Player player) + { + this.RemoveArmor(player); + Manager.getDisguiseManager().undisguise(player); + } + + @EventHandler + public void onInteract(PlayerInteractEvent event) + { + if(!IsActive(event.getPlayer())) return; + + if(!UtilEvent.isAction(event, ActionType.L)) return; + + if(event.getItem() != null && event.getItem().getType() != Material.AIR) return; + + if(Recharge.Instance.use(event.getPlayer(), "Blizzard", 12000, true, true)) + { + event.getPlayer().sendMessage(F.main("Recharge", "You used " + F.skill("Blizzard") + ".")); + } + } + + @EventHandler + public void Snow(UpdateEvent event) + { + if (event.getType() != UpdateType.FASTEST) + return; + + for (Player player : GetActive()) + { + NautHashMap map = Recharge.Instance.Get(player); + if(map == null) continue; + + RechargeData data = map.get("Blizzard"); + if(data == null) continue; + if(data.GetRemaining() < 10000) continue; + + for (int i=0 ; i<4 ; i++) + { + Snowball snow = player.getWorld().spawn(player.getEyeLocation().add(player.getLocation().getDirection()), Snowball.class); + double x = 0.1 - (UtilMath.r(20)/100d); + double y = UtilMath.r(20)/100d; + double z = 0.1 - (UtilMath.r(20)/100d); + snow.setShooter(player); + snow.setVelocity(player.getLocation().getDirection().add(new Vector(x,y,z)).multiply(2)); + _snowball.put(snow, player); + } + + //Effect + player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 0.2f, 0.5f); + } + } + + @EventHandler + public void Snowball(EntityDamageByEntityEvent event) + { + if (!(event.getDamager() instanceof Snowball)) + return; + + Snowball proj = (Snowball) event.getDamager(); + + if (!_snowball.containsKey(proj)) + return; + + GadgetCollideEntityEvent gevent = new GadgetCollideEntityEvent(this, event.getEntity()); + + if(gevent.isCancelled()) return; + + UtilAction.velocity(event.getEntity(), proj.getVelocity().multiply(0.15).add(new Vector(0, 0.15, 0))); + } + + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java index c994f299c..2e65b7ae5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java @@ -20,6 +20,7 @@ import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.OutfitGadget; import mineplex.core.gadget.types.OutfitGadget.ArmorSlot; import mineplex.core.itemstack.ItemStackFactory; @@ -55,7 +56,7 @@ public class OutfitTeam extends OutfitGadget @Override public void ApplyArmor(Player player) { - Manager.RemoveMorph(player); + Manager.removeGadetType(player, GadgetType.Morph); Manager.RemoveOutfit(player, _slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java new file mode 100644 index 000000000..110cbc4e8 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java @@ -0,0 +1,93 @@ +package mineplex.core.gadget.gadgets.particle; + +import java.util.HashMap; +import java.util.UUID; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.ParticleGadget; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class ParticleCandyCane extends ParticleGadget +{ + + private HashMap _map = new HashMap(); + + public ParticleCandyCane(GadgetManager manager) + { + super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, 10, Material.CHEST, (byte)0); + } + + @EventHandler + public void onUpdate(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + for(Player player : GetActive()) + { + if (!shouldDisplay(player)) + continue; + + boolean moving = Manager.isMoving(player); + Location loc = player.getLocation(); + float y = moving? 0.2f : 0.15f; + double yadd = getY(player); + if(!moving && yadd < 2.1) + { + yadd += 0.05; + setY(player, yadd); + } + if(moving && yadd > 0.7) + { + yadd = 0.7; + setY(player, yadd); + } + loc.add(0, yadd, 0); + + float w = 0.2f; + int a = moving? 2 : 6; + + if(!moving) + { + double d = Math.PI*2 * (event.getTick()/50.0); + Vector v = new Vector(Math.sin(d), 0, Math.cos(d)); + loc.add(v); + } + + + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 15), loc, w, y, w, 0, a, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 1), loc, w, y, w, 0, a, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, 2), loc, w, y, w, 0, a, ViewDist.NORMAL); + } + } + + @EventHandler + public void onQuit(PlayerQuitEvent event) + { + _map.remove(event.getPlayer().getUniqueId()); + } + + private void setY(Player p, double y) + { + _map.put(p.getUniqueId(), y); + } + + private double getY(Player p) + { + Double y = _map.get(p.getUniqueId()); + if(y == null) return 3; + return y.doubleValue(); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index 1b0c142f8..7d7a01928 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -30,15 +30,13 @@ public class ParticleFrostLord extends ParticleGadget public ParticleFrostLord(GadgetManager manager) { - super(manager, "Frost Lord", new String[] + super(manager, "Frost Lord Particle", new String[] { C.cWhite + "You are a mighty frost lord.", C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", - " ", - C.cPurple + "No longer available", }, - -1, + 10, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java index de0705c04..596a1e3f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java @@ -11,11 +11,7 @@ import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileLaunchEvent; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -32,7 +28,7 @@ public abstract class ArrowEffectGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.RemoveParticle(player); + Manager.removeGadetType(player, GadgetType.ArrowTrail); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java index fe5b96f0f..031406193 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java @@ -17,7 +17,7 @@ public abstract class DeathEffectGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.RemoveParticle(player); + Manager.removeGadetType(player, GadgetType.Death); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java index a9e3ecfbf..84b02523a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java @@ -23,7 +23,7 @@ public abstract class DoubleJumpEffectGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.RemoveParticle(player); + Manager.removeGadetType(player, GadgetType.DoubleJump); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java index 22de296e7..5daff04b2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetType.java @@ -9,5 +9,7 @@ public enum GadgetType Costume, DoubleJump, ArrowTrail, - Death + Death, + Hat, + Taunt } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java index 232abb0eb..212964745 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java @@ -64,7 +64,7 @@ public abstract class ItemGadget extends Gadget public void ApplyItem(Player player, boolean inform) { - Manager.RemoveItem(player); + Manager.removeGadetType(player, GadgetType.Item); _active.add(player); @@ -157,7 +157,7 @@ public abstract class ItemGadget extends Gadget { UtilInv.Update(player); return; - } + } Manager.getInventoryManager().addItemToInventory(player, GetName(), -1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java index 47e121979..c90606af7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java @@ -19,7 +19,7 @@ public abstract class MorphGadget extends Gadget public void ApplyArmor(Player player) { - Manager.RemoveMorph(player); + Manager.removeGadetType(player, GadgetType.Morph); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java index fabae966d..83c54ac96 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java @@ -34,7 +34,7 @@ public abstract class OutfitGadget extends Gadget public void ApplyArmor(Player player) { - Manager.RemoveMorph(player); + Manager.removeGadetType(player, GadgetType.Morph); Manager.RemoveOutfit(player, _slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java index 3dadb6995..499972786 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java @@ -1,6 +1,5 @@ package mineplex.core.gadget.types; -import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -18,7 +17,7 @@ public abstract class ParticleGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.RemoveParticle(player); + Manager.removeGadetType(player, GadgetType.Particle); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java index 4de2d6666..814280180 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/MountManager.java @@ -23,6 +23,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.DisguiseManager; import mineplex.core.donation.DonationManager; +import mineplex.core.mount.types.MountBabyReindeer; import mineplex.core.mount.types.MountCart; import mineplex.core.mount.types.MountDragon; import mineplex.core.mount.types.MountFrost; @@ -68,6 +69,7 @@ public class MountManager extends MiniPlugin _types.add(new MountSpider(this)); _types.add(new MountZombie(this)); _types.add(new MountTitan(this)); + _types.add(new MountBabyReindeer(this)); //_types.add(new MountSheep(this)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java new file mode 100644 index 000000000..0c5b84e98 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java @@ -0,0 +1,92 @@ +package mineplex.core.mount.types; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Horse.Color; +import org.bukkit.entity.Horse.Style; +import org.bukkit.entity.Horse.Variant; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.HorseJumpEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.mount.HorseMount; +import mineplex.core.mount.MountManager; +import mineplex.core.mount.SingleEntityMountData; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class MountBabyReindeer extends HorseMount +{ + + public MountBabyReindeer(MountManager manager) + { + super(manager, "Baby Rainder", new String[] + { + C.cWhite + "One of Santa's baby reindeers", + C.cWhite + "Still trying to learn how to fly" + }, Material.SNOW_BALL, (byte) 0, 10, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); + } + + @EventHandler + public void EnableCustom(Player player) { + super.EnableCustom(player); + Horse horse = GetActive().get(player).getEntity(); + horse.setBaby(); + horse.setMaxHealth(20); + } + + @EventHandler + public void fly(UpdateEvent event) + { + if(event.getType() != UpdateType.TICK) return; + + for(SingleEntityMountData horse : GetActive().values()) + { + if(horse.getEntity().getPassenger() != horse.getOwner()) continue; + + if(Recharge.Instance.usable(horse.getOwner(), "Reindeer Fly")) continue; + + horse.getEntity().setVelocity(horse.getOwner().getLocation().getDirection().normalize().add(new Vector(0,0.4,0))); + + horse.getEntity().getWorld().playSound(horse.getEntity().getLocation(), Sound.HORSE_BREATHE, 0.3f, 0.5f); + + UtilParticle.PlayParticleToAll(ParticleType.EXPLODE, horse.getEntity().getLocation(), 0.2f,0.0f,0.2f, 0.0f, 10, ViewDist.NORMAL); + } + } + + @EventHandler + public void onClick(PlayerInteractEntityEvent event) + { + if(!IsActive(event.getPlayer())) return; + SingleEntityMountDatadata = getMountData(event.getRightClicked()); + if(data == null) return; + if(data.getOwner() != event.getPlayer()) return; + data.getEntity().setPassenger(data.getOwner()); + } + + @EventHandler + public void onJump(HorseJumpEvent event) + { + SingleEntityMountData data = getMountData(event.getEntity()); + if(data == null) return; + + event.setCancelled(true); + if(UtilEnt.isGrounded(event.getEntity())) + { + if(Recharge.Instance.use(data.getOwner(), "Reindeer Fly", 1000, false, false)) + { + event.getEntity().getWorld().playSound(event.getEntity().getLocation(), Sound.HORSE_ANGRY, 1f, 1f); + } + } + + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java index 4001f5184..49bd13513 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java @@ -36,6 +36,12 @@ public class MountTitan extends Mount @Override public void EnableCustom(Player player) { + if(GetActive().size() >= 3) + { + UtilPlayer.message(player, F.main("Mount", "The maximum amount of simultaneous " + F.elem(GetName()) + " in this lobby has been reached.")); + return; + } + player.leaveVehicle(); player.eject(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java index 56cab2079..de3a66e5e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java @@ -1,19 +1,16 @@ package mineplex.core.pet; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; - -import mineplex.core.common.util.NautHashMap; -import mineplex.core.pet.repository.PetRepository; -import mineplex.core.pet.repository.token.PetExtraToken; -import mineplex.core.pet.repository.token.PetSalesToken; -import mineplex.core.pet.types.Elf; -import mineplex.core.pet.types.Pumpkin; import org.bukkit.Material; import org.bukkit.entity.EntityType; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.pet.repository.PetRepository; +import mineplex.core.pet.types.Elf; +import mineplex.core.pet.types.PetCoalApparition; +import mineplex.core.pet.types.Pumpkin; + public class PetFactory { private PetRepository _repository; @@ -33,6 +30,7 @@ public class PetFactory private void CreatePets() { _pets.put(EntityType.ZOMBIE, new Pumpkin()); + _pets.put(EntityType.PIG_ZOMBIE, new PetCoalApparition()); _pets.put(EntityType.VILLAGER, new Elf()); _pets.put(EntityType.PIG, new Pet("Pig", EntityType.PIG, 5000)); _pets.put(EntityType.SHEEP, new Pet("Sheep", EntityType.SHEEP, 3000)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index d111bc6a7..8ca696f34 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -4,11 +4,38 @@ import java.util.Collection; import java.util.Iterator; import java.util.Map.Entry; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPigZombie; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.Creature; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.PigZombie; +import org.bukkit.entity.Player; +import org.bukkit.entity.Skeleton; +import org.bukkit.entity.Villager; +import org.bukkit.entity.Zombie; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityTargetEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import com.google.gson.Gson; + import mineplex.core.MiniClientPlugin; -import mineplex.core.pet.repository.PetRepository; -import mineplex.core.pet.repository.token.ClientPetTokenWrapper; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; import mineplex.core.account.CoreClientManager; import mineplex.core.account.event.ClientWebResponseEvent; import mineplex.core.blockrestore.BlockRestore; @@ -17,50 +44,22 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.disguises.DisguiseGuardian; import mineplex.core.disguise.disguises.DisguiseWither; import mineplex.core.donation.DonationManager; import mineplex.core.inventory.InventoryManager; +import mineplex.core.pet.repository.PetRepository; +import mineplex.core.pet.repository.token.ClientPetTokenWrapper; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import net.minecraft.server.v1_8_R3.EntityCreature; -import net.minecraft.server.v1_8_R3.EntityWither; -import net.minecraft.server.v1_8_R3.Navigation; import net.minecraft.server.v1_8_R3.NavigationAbstract; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; - -import com.google.gson.Gson; - -import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; -import org.bukkit.entity.Ageable; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Guardian; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.entity.Skeleton; -import org.bukkit.entity.Villager; -import org.bukkit.entity.Zombie; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.player.PlayerInteractEntityEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - public class PetManager extends MiniClientPlugin { private static Object _petOwnerSynch = new Object(); @@ -228,6 +227,12 @@ public class PetManager extends MiniClientPlugin pet.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0)); UtilEnt.silence(pet, true); } + if (pet instanceof PigZombie) + { + ((PigZombie)pet).setBaby(true); + pet.getEquipment().setHelmet(new ItemStack(Material.SKULL_ITEM, 1, (short)0, (byte) 1)); + pet.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999999, 0)); + } else if (pet instanceof Villager) { ((Villager) pet).setBaby(); @@ -342,6 +347,22 @@ public class PetManager extends MiniClientPlugin @EventHandler public void onUpdate(UpdateEvent event) { + if (event.getType() == UpdateType.TICK) + { + for(Creature pet : _activePetOwners.values()) + { + if(pet instanceof PigZombie) + { + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, pet.getLocation(), 0.2f,0.0f,0.2f, 0.0f, 4, ViewDist.NORMAL); + if(event.getTick()%3 == 0) pet.getWorld().playSound(pet.getLocation(), Sound.BLAZE_BREATH, 0.1f, 0f); + if(!((CraftPigZombie)pet).getHandle().isSilent()) + { + ((CraftPigZombie)pet).getHandle().setSilent(true); + } + } + } + } + if (event.getType() != UpdateType.FAST) return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java new file mode 100644 index 000000000..5c0b7ed82 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java @@ -0,0 +1,14 @@ +package mineplex.core.pet.types; + +import org.bukkit.entity.EntityType; + +import mineplex.core.pet.Pet; + +public class PetCoalApparition extends Pet +{ + public PetCoalApparition() + { + super("Coal Apparition", EntityType.PIG_ZOMBIE, 10); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/event/UpdateEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/event/UpdateEvent.java index 59400f196..60c7f0bb8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/updater/event/UpdateEvent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/event/UpdateEvent.java @@ -1,6 +1,7 @@ package mineplex.core.updater.event; import mineplex.core.updater.UpdateType; +import net.minecraft.server.v1_8_R3.MinecraftServer; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; @@ -19,6 +20,11 @@ public class UpdateEvent extends Event { return _type; } + + public int getTick() + { + return MinecraftServer.currentTick; + } public HandlerList getHandlers() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java index c35fc9ab5..5b7237994 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java @@ -169,7 +169,7 @@ public class DisguiseCommand extends CommandBase implements Liste changeName(caller, args[0], true); - Plugin.getCosmeticManager().getGadgetManager().RemoveItem(caller); + Plugin.getCosmeticManager().getGadgetManager().removeGadetType(caller, GadgetType.Item); Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller)); UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]); From b1536547d36ce13ad8913e6a5edaaf3b4135032b Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Tue, 8 Dec 2015 00:50:08 +0100 Subject: [PATCH 04/51] Cosmetic Update 2 + Item Coal + Freeze Cannon + Party Popper / Party Bomb + Snowball + Coal Fumes Particle + Snowman sneak trail/glide + Teaked stuff --- .../core/common/util/UtilParticle.java | 33 ++- .../mineplex/core/gadget/GadgetManager.java | 8 + .../core/gadget/gadgets/item/ItemCoal.java | 126 +++++++++++ .../gadget/gadgets/item/ItemFirework.java | 3 +- .../gadget/gadgets/item/ItemFreezeCannon.java | 197 ++++++++++++++++++ .../gadget/gadgets/item/ItemPartyPopper.java | 141 +++++++++++++ .../gadget/gadgets/item/ItemSnowball.java | 61 ++++++ .../gadget/gadgets/morph/MorphSnowman.java | 64 ++++-- .../gadgets/particle/ParticleCoalFumes.java | 45 ++++ .../src/mineplex/core/pet/PetManager.java | 2 +- .../src/mineplex/core/updater/UpdateType.java | 66 ++++++ .../src/mineplex/hub/HubManager.java | 3 +- .../hub/commands/DisguiseCommand.java | 2 +- 13 files changed, 720 insertions(+), 31 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java index bacca401f..a1b747a9e 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilParticle.java @@ -249,12 +249,30 @@ public class UtilParticle public static void PlayParticleToAll(ParticleType type, Location location, Vector offset, float speed, int count, ViewDist dist) { - PlayParticle(type, location, (float) offset.getX(), (float) offset.getY(), (float) offset.getZ(), speed, count, dist, UtilServer.getPlayers()); + float x = 0; + float y = 0; + float z = 0; + if(offset != null) + { + x = (float) offset.getX(); + y = (float) offset.getY(); + z = (float) offset.getZ(); + } + PlayParticle(type, location, x, y, z, speed, count, dist, UtilServer.getPlayers()); } public static void PlayParticle(ParticleType type, Location location, Vector offset, float speed, int count, ViewDist dist, Player... players) { - PlayParticle(type, location, (float) offset.getX(), (float) offset.getY(), (float) offset.getZ(), speed, count, dist, players); + float x = 0; + float y = 0; + float z = 0; + if(offset != null) + { + x = (float) offset.getX(); + y = (float) offset.getY(); + z = (float) offset.getZ(); + } + PlayParticle(type, location, x, y, z, speed, count, dist, players); } public static void PlayParticleToAll(ParticleType type, Location location, float offsetX, float offsetY, float offsetZ, @@ -286,7 +304,16 @@ public class UtilParticle public static void PlayParticleToAll(String particle, Location location, Vector offset, float speed, int count, ViewDist dist) { - PlayParticle(particle, location, (float) offset.getX(), (float) offset.getY(), (float) offset.getZ(), speed, count, dist, UtilServer.getPlayers()); + float x = 0; + float y = 0; + float z = 0; + if(offset != null) + { + x = (float) offset.getX(); + y = (float) offset.getY(); + z = (float) offset.getZ(); + } + PlayParticle(particle, location, x, y, z, speed, count, dist, UtilServer.getPlayers()); } public static void PlayParticleToAll(String particle, Location location, float offsetX, float offsetY, float offsetZ, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 836cc0aec..e799d89e9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -39,15 +39,18 @@ import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; import mineplex.core.gadget.gadgets.item.ItemBatGun; +import mineplex.core.gadget.gadgets.item.ItemCoal; import mineplex.core.gadget.gadgets.item.ItemCoinBomb; import mineplex.core.gadget.gadgets.item.ItemDuelingSword; import mineplex.core.gadget.gadgets.item.ItemEtherealPearl; import mineplex.core.gadget.gadgets.item.ItemFirework; import mineplex.core.gadget.gadgets.item.ItemFleshHook; +import mineplex.core.gadget.gadgets.item.ItemFreezeCannon; import mineplex.core.gadget.gadgets.item.ItemMelonLauncher; import mineplex.core.gadget.gadgets.item.ItemPaintballGun; import mineplex.core.gadget.gadgets.item.ItemPaintbrush; import mineplex.core.gadget.gadgets.item.ItemPartyPopper; +import mineplex.core.gadget.gadgets.item.ItemSnowball; import mineplex.core.gadget.gadgets.item.ItemTNT; import mineplex.core.gadget.gadgets.morph.MorphBat; import mineplex.core.gadget.gadgets.morph.MorphBlaze; @@ -68,6 +71,7 @@ import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit; import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit; import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.gadgets.particle.ParticleCandyCane; +import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; import mineplex.core.gadget.gadgets.particle.ParticleEnchant; import mineplex.core.gadget.gadgets.particle.ParticleFairy; import mineplex.core.gadget.gadgets.particle.ParticleFireRings; @@ -147,6 +151,9 @@ public class GadgetManager extends MiniPlugin addGadget(new ItemPaintbrush(this)); addGadget(new ItemDuelingSword(this)); addGadget(new ItemPartyPopper(this)); + addGadget(new ItemCoal(this)); + addGadget(new ItemFreezeCannon(this)); + addGadget(new ItemSnowball(this)); // Costume addGadget(new OutfitRaveSuit(this, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0)); @@ -194,6 +201,7 @@ public class GadgetManager extends MiniPlugin addGadget(new ParticleFrostLord(this)); addGadget(new ParticleTitan(this)); addGadget(new ParticleCandyCane(this)); + addGadget(new ParticleCoalFumes(this)); // Arrow Trails addGadget(new ArrowTrailFrostLord(this)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java new file mode 100644 index 000000000..38ff604cc --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -0,0 +1,126 @@ +package mineplex.core.gadget.gadgets.item; + +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.Callback; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilGear; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent; +import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.types.ItemGadget; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; + +public class ItemCoal extends ItemGadget +{ + + public String[] Messages = new String[] + { + "Maybe you could.... eat it?", + "Yep, you're holding some coal...", + "This sure is a nice piece of coal!", + "Na na na na Na na na na " + C.cDGray + "BLACK COAL" + C.mBody + "!", + "Did you know that coal can be used for " + C.Scramble + "nothing" + C.mBody + "!", + }; + + public ItemCoal(GadgetManager manager) + { + super(manager, "Coal", new String[] + { + C.cDGray + "Exclusive Coal!", + C.cDGray + "Earned by beeing naughty" + } + , -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] + { + C.cDGray + "Exclusive Coal!", + C.cDGray + "Earned by beeing naughty" + } + , 100, 100)); + } + + @Override + public void ActivateCustom(final Player player) + { + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) + { + player.sendMessage(F.main("Coal", "You unlocked " + C.cDGray + "COAL FUMES!")); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); + player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); + Manager.getInventoryManager().addItemToInventory(new Callback() + { + @Override + public void run(Boolean data) + { + Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); + player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + } + }, player, "Coal Fumes", 1); + return; + } + + int i = UtilMath.r(Messages.length); + String msg = Messages[i]; + player.sendMessage(F.main("Coal", msg)); + player.playSound(player.getLocation(), Sound.GHAST_FIREBALL, 0.2f, 1.5f*(i/(float)Messages.length)); + } + + @EventHandler @Override + public void Activate(PlayerInteractEvent event) + { + if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) + return; + + if (UtilBlock.usable(event.getClickedBlock())) + return; + + if (!UtilGear.isMat(event.getPlayer().getItemInHand(), this.GetDisplayMaterial())) + return; + + Player player = event.getPlayer(); + + if (!IsActive(player)) + return; + + event.setCancelled(true); + + //Stock + if (Manager.getInventoryManager().Get(player).getItemCount(GetName()) <= 0) + { + + UtilPlayer.message(player, F.main("Gadget", "You do not have any " + GetName() + " left.")); + + ItemGadgetOutOfAmmoEvent ammoEvent = new ItemGadgetOutOfAmmoEvent(event.getPlayer(), this); + Bukkit.getServer().getPluginManager().callEvent(ammoEvent); + + return; + } + + //Recharge + if (!Recharge.Instance.use(player, GetName(), GetName(), _recharge, _recharge > 1000, true, false, true, "Cosmetics")) + { + UtilInv.Update(player); + return; + } + + player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + + ActivateCustom(event.getPlayer()); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java index 0462dd311..1f7463054 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java @@ -2,9 +2,9 @@ package mineplex.core.gadget.gadgets.item; import org.bukkit.Color; import org.bukkit.FireworkEffect; +import org.bukkit.FireworkEffect.Type; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -17,7 +17,6 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; -import mineplex.core.recharge.Recharge; public class ItemFirework extends ItemGadget { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java new file mode 100644 index 000000000..d8ac3177e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java @@ -0,0 +1,197 @@ +package mineplex.core.gadget.gadgets.item; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; + +import org.bukkit.Bukkit; +import org.bukkit.Effect; +import org.bukkit.EntityEffect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.types.ItemGadget; +import mineplex.core.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.recharge.Recharge; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class ItemFreezeCannon extends ItemGadget implements IThrown +{ + + private HashMap _playerMap = new HashMap<>(); + + public ItemFreezeCannon(GadgetManager manager) + { + super(manager, "Freeze Cannon", new String[] + { + C.cWhite + "Freeze your nemesis inside a block of ice!" + } + , -1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[] + { + C.cWhite + "100 Ice Blocks for you to launch!" + }, 500, 100)); + } + + @Override + public void ActivateCustom(Player player) + { + Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.ICE)); + UtilAction.velocity(item, player.getLocation().getDirection(), + 1, false, 0, 0.2, 10, false); + + Manager.getProjectileManager().AddThrow(item, player, this, 5000, true, true, true, true, + null, 1f, 1f, null, null, 0, UpdateType.TICK, 0.5f); + + //Inform + UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + ".")); + + //Effect + item.getWorld().playSound(item.getLocation(), Sound.EXPLODE, 0.5f, 0.5f); + } + + @Override + public void Collide(LivingEntity target, Block block, ProjectileUser data) + { + if (target instanceof Player) + { + Player p = (Player) target; + + int ticks = 4 * 20; + if(isClear(p.getLocation())) + { + Manager.getBlockRestore().add(p.getLocation().getBlock(), Material.STAINED_GLASS.getId(), (byte)5, 0, (byte)0, ticks*50); + Manager.getBlockRestore().add(p.getLocation().getBlock().getRelative(BlockFace.UP), Material.STAINED_GLASS.getId(), (byte)5, 0, (byte)0, ticks*50); + if(p.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR) + { + Manager.getBlockRestore().add(p.getLocation().getBlock().getRelative(BlockFace.DOWN), Material.STAINED_GLASS.getId(), (byte)5, 0, (byte)0, ticks*50); + } + p.setWalkSpeed(0); + _playerMap.put(p, System.currentTimeMillis() + (ticks * 50)); + p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, ticks, 250, true, false)); + p.teleport(target.getLocation().getBlock().getLocation().add(0.5, 0, 0.5)); + Recharge.Instance.useForce(p, "Double Jump", ticks*50); + p.setAllowFlight(false); + p.getWorld().playSound(p.getLocation(), Sound.FIZZ, 0.25f, 0.75f); + } + + //Effect + target.playEffect(EntityEffect.HURT); + } + + smash(data.GetThrown()); + } + + @EventHandler + public void onMove(PlayerMoveEvent event) + { + if(!_playerMap.containsKey(event.getPlayer())) return; + + if(event.getFrom().distanceSquared(event.getTo()) > 0.3) + { + event.setCancelled(true); + } + } + + public boolean isClear(Location loc) + { + Block b = loc.getBlock(); + ArrayList blocks = UtilBlock.getInBoundingBox(b.getLocation().subtract(1, 0, 1), b.getLocation().add(1, 1, 1)); + for(Block test : blocks) + { + if(test.getType() == Material.PORTAL) return false; + } + if(b.getType() != Material.AIR) return false; + if(b.getRelative(BlockFace.UP).getType() != Material.AIR) return false; + + return true; + } + + @EventHandler + public void cleanup(UpdateEvent event) + { + if(event.getType() == UpdateType.FAST) + { + for(Iterator it = _playerMap.keySet().iterator(); it.hasNext();) + { + Player p = it.next(); + Long time = _playerMap.get(p); + if(time == null) + { + p.setWalkSpeed(0.2f); + p.setAllowFlight(false); + it.remove(); + continue; + } + if(time < System.currentTimeMillis()) + { + p.setWalkSpeed(0.2f); + p.setAllowFlight(false); + it.remove(); + continue; + } + } + } + if(event.getType() == UpdateType.TICK) + { + for(Player p : _playerMap.keySet()) + { + Long time = _playerMap.get(p); + if(time <= System.currentTimeMillis()) continue; + + for(Player op : UtilServer.getPlayers()) + { + if(op.equals(p)) continue; + op.sendBlockChange(p.getLocation(), Material.ICE, (byte) 0); + op.sendBlockChange(p.getLocation().add(0, 1, 0), Material.ICE, (byte) 0); + } + } + } + } + + @Override + public void Idle(ProjectileUser data) + { + smash(data.GetThrown()); + } + + @Override + public void Expire(ProjectileUser data) + { + smash(data.GetThrown()); + } + + public void smash(Entity ent) + { + //Effect + ent.getWorld().playEffect(ent.getLocation(), Effect.STEP_SOUND, Material.ICE); + + //Remove + ent.remove(); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java new file mode 100644 index 000000000..2a44e16da --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -0,0 +1,141 @@ +package mineplex.core.gadget.gadgets.item; + +import java.util.HashSet; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.types.ItemGadget; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.projectile.IThrown; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class ItemPartyPopper extends ItemGadget implements IThrown +{ + HashSet _items = new HashSet<>(); + + public ItemPartyPopper(GadgetManager manager) + { + super(manager, "Confetti Bomb", new String[] + { + C.cWhite + "POP BANG!", + }, -1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "100 Party Poppers", Material.DIAMOND_BARDING, + (byte) 0, new String[] + { + C.cWhite + "100 Party Poppers for you to shoot!" + }, 500, 100)); + } + + @Override + public void ActivateCustom(Player player) + { + + Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), + ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random())); + + UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false); + + Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); + + /* + for(int data : new int[]{1,2,4,5,6,9,10,11,12,13,14,15}) + { + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), null, 0.4f, 50, ViewDist.LONG); + /* + for(int i = 0; i < 10; i++) + { + Vector v = new Vector(Math.random() - 0.5, Math.random() - 0.3, Math.random() - 0.5); + v.normalize(); + v.multiply(0.2); + v.add(player.getLocation().getDirection()); + v.normalize().multiply(Math.random()*0.4 + 0.4); + + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), v, 1, 0, ViewDist.LONG); + } + + /* + Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), + ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)data, 1, "Ink" + Math.random())); + _items.add(ent); + + Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.3, Math.random() - 0.5); + random.normalize(); + random.multiply(0.05); + + UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.3).add(random), 1 + 0.4 * Math.random(), false, 0, 0.2, 10, false); + + Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); + */ +// } + // Sound + for(int i = 0; i < 3; i++) + { + player.getWorld().playSound(player.getLocation(), Sound.CHICKEN_EGG_POP, 2.0f, 0.8f); + } + } + + @Override + public void Collide(LivingEntity target, Block block, ProjectileUser data) + { + Explode(data); + } + + @Override + public void Idle(ProjectileUser data) + { + Explode(data); + } + + @Override + public void Expire(ProjectileUser data) + { + Explode(data); + } + + @EventHandler + public void particleTrail(UpdateEvent event) + { + if(event.getType() != UpdateType.TICK) return; + + for(Item item : _items) + { + byte data = item.getItemStack().getData().getData(); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), item.getLocation(), 0, 0, 0, 0.0f, 3, ViewDist.LONG); + } + } + + public void Explode(ProjectileUser data) + { + for(int type : new int[]{1,2,4,5,6,9,10,11,12,13,14,15}) + { + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, type), data.GetThrown().getLocation(), null, 0.4f, 50, ViewDist.LONG); + } + data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f); + data.GetThrown().remove(); + /* + if (data.GetThrown() instanceof Item) + { + Item item = (Item) data.GetThrown(); + byte b = item.getItemStack().getData().getData(); + UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, b), item.getLocation(), 0, 0, 0, 0.2f, 80, ViewDist.LONG); + _items.remove(item); + } + data.GetThrown().getWorld().playSound(data.GetThrown().getLocation(), Sound.LAVA_POP, 0.75f, 1.25f); + data.GetThrown().remove(); + */ + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java new file mode 100644 index 000000000..ce1f5dc79 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java @@ -0,0 +1,61 @@ +package mineplex.core.gadget.gadgets.item; + +import java.util.HashSet; + +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.entity.Snowball; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilAction; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.event.GadgetCollideEntityEvent; +import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.types.ItemGadget; + +public class ItemSnowball extends ItemGadget +{ + + private HashSet _snowballs = new HashSet<>(); + + public ItemSnowball(GadgetManager manager) + { + super(manager, "Snowball", new String[] + { + C.cWhite + "Throw snowball!", + C.cWhite + "Start epic snowfights!" + } + , -1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "50 Snowballs", Material.SNOW_BALL, (byte) 0, new String[] + { + C.cWhite + "50 Snowballs for you to throw!" + } + , 100, 50)); + + } + + @Override + public void ActivateCustom(Player player) + { + Snowball ball = player.launchProjectile(Snowball.class); + _snowballs.add(ball); + ball.getWorld().playSound(ball.getLocation(), Sound.CHICKEN_EGG_POP, 1f, 0.3f); + } + + @EventHandler + public void onHit(EntityDamageByEntityEvent event) + { + if(!_snowballs.contains(event.getDamager())) return; + + GadgetCollideEntityEvent gevent = new GadgetCollideEntityEvent(this, event.getEntity()); + + if(gevent.isCancelled()) return; + + UtilAction.velocity(event.getEntity(), event.getDamager().getVelocity().normalize().add(new Vector(0,0.5,0))); + event.getDamager().getWorld().playSound(event.getDamager().getLocation(), Sound.STEP_SNOW, 1, 0.5f); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java index 6e7d29b8e..40a7ff8cd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java @@ -16,9 +16,13 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.disguise.disguises.DisguiseSnowman; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetCollideEntityEvent; @@ -77,31 +81,45 @@ public class MorphSnowman extends MorphGadget @EventHandler public void Snow(UpdateEvent event) { - if (event.getType() != UpdateType.FASTEST) - return; - - for (Player player : GetActive()) + if (event.getType() == UpdateType.FASTEST) { - NautHashMap map = Recharge.Instance.Get(player); - if(map == null) continue; - - RechargeData data = map.get("Blizzard"); - if(data == null) continue; - if(data.GetRemaining() < 10000) continue; - - for (int i=0 ; i<4 ; i++) - { - Snowball snow = player.getWorld().spawn(player.getEyeLocation().add(player.getLocation().getDirection()), Snowball.class); - double x = 0.1 - (UtilMath.r(20)/100d); - double y = UtilMath.r(20)/100d; - double z = 0.1 - (UtilMath.r(20)/100d); - snow.setShooter(player); - snow.setVelocity(player.getLocation().getDirection().add(new Vector(x,y,z)).multiply(2)); - _snowball.put(snow, player); - } - //Effect - player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 0.2f, 0.5f); + for (Player player : GetActive()) + { + NautHashMap map = Recharge.Instance.Get(player); + if(map == null) continue; + + RechargeData data = map.get("Blizzard"); + if(data == null) continue; + if(data.GetRemaining() < 10000) continue; + + for (int i=0 ; i<4 ; i++) + { + Snowball snow = player.getWorld().spawn(player.getEyeLocation().add(player.getLocation().getDirection()), Snowball.class); + double x = 0.1 - (UtilMath.r(20)/100d); + double y = UtilMath.r(20)/100d; + double z = 0.1 - (UtilMath.r(20)/100d); + snow.setShooter(player); + snow.setVelocity(player.getLocation().getDirection().add(new Vector(x,y,z)).multiply(2)); + _snowball.put(snow, player); + } + + //Effect + player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 0.2f, 0.5f); + } + } + + if(event.getType() == UpdateType.TICK) + { + for (Player player : GetActive()) + { + if(player.isSneaking() && UtilEnt.isGrounded(player)) + { + player.setVelocity(player.getLocation().getDirection().setY(0).normalize()); + UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation(), 0.3f, 0.1f, 0.3f, 0, 10, ViewDist.NORMAL); + player.getWorld().playSound(player.getLocation(), Sound.STEP_SNOW, 0.3f, 0.3f); + } + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java new file mode 100644 index 000000000..04ccec81d --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java @@ -0,0 +1,45 @@ +package mineplex.core.gadget.gadgets.particle; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.ParticleGadget; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + +public class ParticleCoalFumes extends ParticleGadget +{ + + public ParticleCoalFumes(GadgetManager manager) + { + super(manager, "Coal Fumes", new String[] + { + C.cDGray + "Nothing to read here. Please move on." + }, -1, Material.COAL, (byte) 0); + } + + @EventHandler + public void onUpdate(UpdateEvent event) + { + if(event.getType() != UpdateType.TICK) return; + + int dur = 200; + int tick = Math.abs(event.getTick()%dur); + + + double d = tick/(double)dur; + float xz = (float) Math.sin(d*Math.PI); + + for(Player p : GetActive()) + { + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, p.getLocation(), xz, 0, xz, 0, 5, ViewDist.NORMAL); + } + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java index 8ca696f34..4e609930f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetManager.java @@ -354,7 +354,7 @@ public class PetManager extends MiniClientPlugin if(pet instanceof PigZombie) { UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, pet.getLocation(), 0.2f,0.0f,0.2f, 0.0f, 4, ViewDist.NORMAL); - if(event.getTick()%3 == 0) pet.getWorld().playSound(pet.getLocation(), Sound.BLAZE_BREATH, 0.1f, 0f); + if(event.getTick()%3 == 0) pet.getWorld().playSound(pet.getLocation(), Sound.BLAZE_BREATH, 0.03f, 0f); if(!((CraftPigZombie)pet).getHandle().isSilent()) { ((CraftPigZombie)pet).getHandle().setSilent(true); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java b/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java index 0b6c89cfb..52d63e2a1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/updater/UpdateType.java @@ -4,27 +4,93 @@ import mineplex.core.common.util.UtilTime; public enum UpdateType { + /** + * Once every 64 minutes + */ MIN_64(3840000), + /** + * Once every 60 minutes + */ HOUR_01(3600000), + /** + * Once every 32 minutes + */ MIN_32(1920000), + /** + * Once every 30 minutes + */ MIN_30(1800000), + /** + * Once every 16 minutes + */ MIN_16(960000), + /** + * Once every 10 minutes + */ MIN_10(600000), + /** + * Once every 8 minutes + */ MIN_08(480000), + /** + * Once every 5 minutes + */ MIN_05(300000), + /** + * Once every 4 minutes + */ MIN_04(240000), + /** + * Once every 2 minutes + */ MIN_02(120000), + /** + * Once every minute + */ MIN_01(60000), + /** + * Once every 32 seconds + */ SLOWEST(32000), + /** + * ONce every 30 seconds + */ SEC_30(30000), + /** + * Once every 16 seconds + */ SLOWER(16000), + /** + * Once every 8 seconds + */ SEC_08(8000), + /** + * Once every 4 seconds + */ SLOW(4000), + /** + * Once every 40 ticks + */ TWOSEC(2000), + /** + * Once every 20 ticks + */ SEC(1000), + /** + * Once every 10 ticks + */ FAST(500), + /** + * Once every 5 ticks + */ FASTER(250), + /** + * Once every 3 ticks + */ FASTEST(125), + /** + * Once every tick + */ TICK(49); private long _time; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 4ae6eea74..ad5f421a0 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -30,6 +30,7 @@ import mineplex.core.donation.DonationManager; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetActivateEvent; import mineplex.core.gadget.event.GadgetCollideEntityEvent; +import mineplex.core.gadget.types.GadgetType; import mineplex.core.giveaway.GiveawayManager; import mineplex.core.hologram.HologramManager; import mineplex.core.inventory.InventoryManager; @@ -279,7 +280,7 @@ public class HubManager extends MiniClientPlugin Player player = event.getPlayer(); - _gadgetManager.RemoveItem(player); + _gadgetManager.removeGadetType(player, GadgetType.Item); player.getInventory().setItem(3, new ItemStack(Material.SNOW_BALL, 16)); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java index d76e0db30..cc55696c8 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java @@ -176,7 +176,7 @@ public class DisguiseCommand extends CommandBase implements Listener changeName(caller, args[0]); - Plugin.GetGadget().RemoveItem(caller); + Plugin.GetGadget().removeGadetType(caller, GadgetType.Item); UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]); } catch(Exception e) From d16d9a36e9e86d95ed904016d90b320dff2eec32 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 17:25:39 -0500 Subject: [PATCH 05/51] Use Account ID from client manager instead of PlayerCache --- .../src/mineplex/core/inventory/InventoryManager.java | 3 ++- .../src/mineplex/core/treasure/TreasureStyle.java | 10 +++++++++- .../src/mineplex/core/treasure/TreasureType.java | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java index 82becc622..0a32aa977 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java @@ -93,6 +93,7 @@ public class InventoryManager extends MiniDbClientPlugin public void addItemToInventory(final Callback callback, final Player player, final String item, final int count) { + int accountId = getClientManager().getAccountId(player); addItemToInventoryForOffline(new Callback() { public void run(Boolean success) @@ -105,7 +106,7 @@ public class InventoryManager extends MiniDbClientPlugin if (callback != null) callback.run(success); } - }, player.getUniqueId(), item, count); + }, accountId, item, count); } public boolean validItem(String item) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java index 8875cac4a..38828ee6b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureStyle.java @@ -25,7 +25,15 @@ public enum TreasureStyle ParticleType.LARGE_EXPLODE, ParticleType.INSTANT_SPELL, Sound.PORTAL_TRAVEL, - Sound.ANVIL_LAND); + Sound.ANVIL_LAND), + + CHRISTMAS( + ParticleType.SNOW_SHOVEL, + ParticleType.SNOWBALL_POOF, + ParticleType.FIREWORKS_SPARK, + Sound.FIZZ, + Sound.CHICKEN_EGG_POP + ); private ParticleType _secondaryParticle; private ParticleType _chestSpawnParticle; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java index 1d6a5a399..ab8660490 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java @@ -11,7 +11,9 @@ public enum TreasureType ANCIENT(C.cGold + "Ancient Chest", "Ancient Chest", "Ancient", RewardType.AncientChest, Material.TRAPPED_CHEST, TreasureStyle.ANCIENT), - MYTHICAL(C.cRed + "Mythical Chest", "Mythical Chest", "Mythical", RewardType.MythicalChest, Material.ENDER_CHEST, TreasureStyle.MYTHICAL); + MYTHICAL(C.cRed + "Mythical Chest", "Mythical Chest", "Mythical", RewardType.MythicalChest, Material.ENDER_CHEST, TreasureStyle.MYTHICAL), + + CHRISTMAS(C.cAqua + "Christmas Chest", "Christmas Chest", "Christmas", RewardType.MythicalChest, Material.CHEST, TreasureStyle.CHRISTMAS); private final String _name; private final RewardType _rewardType; From a6a4c8be361bf8303b614d10dbad9f7ed8c694eb Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Fri, 11 Dec 2015 01:05:32 +0100 Subject: [PATCH 06/51] Cosmetic Update + Added GadgetDisable Event + Renamed GadgetActivateEvent to GadgetEnable event + Added hat framework, and some example hats + Added sets and Frost Lord set + Fixed some imports + Added new way of checking ownership of gadgets + Added some utility methods to GadgetManager + Added support for alternative package name of gadgets + Fixed coal + New Blood Helix particle --- .../core/cosmetic/ui/page/CostumePage.java | 3 + .../core/cosmetic/ui/page/GadgetPage.java | 2 +- .../core/cosmetic/ui/page/HatPage.java | 11 ++ .../mineplex/core/gadget/GadgetManager.java | 107 ++++++++++-------- .../core/gadget/event/GadgetDisableEvent.java | 43 +++++++ ...ivateEvent.java => GadgetEnableEvent.java} | 7 +- .../arrowtrail/ArrowTrailFrostLord.java | 4 +- .../gadget/gadgets/death/DeathFrostLord.java | 2 +- .../doublejump/DoubleJumpFrostLord.java | 10 +- .../core/gadget/gadgets/hat/HatCoal.java | 18 +++ .../core/gadget/gadgets/hat/HatPresent.java | 15 +++ .../core/gadget/gadgets/hat/HatSanta.java | 15 +++ .../core/gadget/gadgets/hat/HatSnowman.java | 15 +++ .../core/gadget/gadgets/item/ItemCoal.java | 18 ++- .../gadget/gadgets/outfit/OutfitTeam.java | 4 +- .../gadgets/particle/ParticleFrostLord.java | 28 +++-- .../gadgets/particle/ParticleHelix.java | 59 +++++++++- .../gadgets/particle/ParticleTitan.java | 7 +- .../core/gadget/set/SetFrostLord.java | 38 +++++++ .../core/gadget/types/ArrowEffectGadget.java | 4 +- .../core/gadget/types/DeathEffectGadget.java | 4 +- .../gadget/types/DoubleJumpEffectGadget.java | 8 +- .../mineplex/core/gadget/types/Gadget.java | 31 ++++- .../mineplex/core/gadget/types/GadgetSet.java | 93 +++++++++++++++ .../mineplex/core/gadget/types/HatGadget.java | 92 +++++++++++++++ .../core/gadget/types/MusicGadget.java | 4 +- .../core/gadget/types/ParticleGadget.java | 4 +- .../game/arcade/command/DisguiseCommand.java | 4 +- .../arcade/game/games/event/EventGame.java | 8 +- 29 files changed, 546 insertions(+), 112 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetDisableEvent.java rename Plugins/Mineplex.Core/src/mineplex/core/gadget/event/{GadgetActivateEvent.java => GadgetEnableEvent.java} (88%) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java index 144131e81..803f8705f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java @@ -3,11 +3,14 @@ package mineplex.core.cosmetic.ui.page; import java.util.ArrayList; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; +import com.sun.org.glassfish.gmbal.ManagedAttribute; + import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; import mineplex.core.cosmetic.CosmeticManager; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index cebfad6bd..317f6503c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -109,7 +109,7 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cWhite + "Your Ammo : " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName())); } - if (gadget.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(gadget.GetName()) || getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName()) > 0) + if (gadget.ownsGadget(getPlayer())) { if (gadget.GetActive().contains(getPlayer())) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java index 8ea9fff22..4ff3ded5a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java @@ -5,6 +5,8 @@ import java.util.List; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.SkullMeta; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; @@ -13,6 +15,7 @@ import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; +import mineplex.core.gadget.types.HatGadget; import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; @@ -37,6 +40,14 @@ public class HatPage extends GadgetPage { addGadget(gadget, slot); + ItemStack item = getItem(slot); + if(item.getType() == Material.SKULL_ITEM) + { + SkullMeta data = (SkullMeta) item.getItemMeta(); + data.setOwner(((SkullMeta)((HatGadget)gadget).getHelmetItem().getItemMeta()).getOwner()); + item.setItemMeta(data); + } + if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) addGlow(slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index e799d89e9..7af09dfe5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -1,7 +1,9 @@ package mineplex.core.gadget; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -38,6 +40,10 @@ import mineplex.core.gadget.gadgets.death.DeathTitan; import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; +import mineplex.core.gadget.gadgets.hat.HatCoal; +import mineplex.core.gadget.gadgets.hat.HatPresent; +import mineplex.core.gadget.gadgets.hat.HatSanta; +import mineplex.core.gadget.gadgets.hat.HatSnowman; import mineplex.core.gadget.gadgets.item.ItemBatGun; import mineplex.core.gadget.gadgets.item.ItemCoal; import mineplex.core.gadget.gadgets.item.ItemCoinBomb; @@ -83,7 +89,9 @@ import mineplex.core.gadget.gadgets.particle.ParticleHelix; import mineplex.core.gadget.gadgets.particle.ParticleLegend; import mineplex.core.gadget.gadgets.particle.ParticleRain; import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.set.SetFrostLord; import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetSet; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.gadget.types.MusicGadget; @@ -113,6 +121,8 @@ public class GadgetManager extends MiniPlugin private NautHashMap _lastMove = new NautHashMap(); private NautHashMap> _playerActiveGadgetMap = new NautHashMap>(); + private HashSet _sets = new HashSet<>(); + private boolean _hideParticles = false; private int _activeItemSlot = 3; @@ -133,6 +143,12 @@ public class GadgetManager extends MiniPlugin _achievementManager = achievementManager; CreateGadgets(); + createSets(); + } + + private void createSets() + { + addSet(new SetFrostLord(this)); } private void CreateGadgets() @@ -218,6 +234,11 @@ public class GadgetManager extends MiniPlugin addGadget(new DoubleJumpTitan(this)); addGadget(new DoubleJumpCandyCane(this)); + // Hat + addGadget(new HatSanta(this)); + addGadget(new HatSnowman(this)); + addGadget(new HatPresent(this)); + addGadget(new HatCoal(this)); // Music addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000)); @@ -233,6 +254,42 @@ public class GadgetManager extends MiniPlugin addGadget(new MusicGadget(this, "Wait Disc", new String[] {""}, -2, 2267, 238000)); } + public Gadget getGadget(Class c) + { + for(GadgetType type : GadgetType.values()) + { + for(Gadget gadget : getGadgets(type)) + { + if(gadget.getClass().equals(c)) return gadget; + } + } + return null; + } + + public Set getSets(Gadget gadget) + { + HashSet hset = new HashSet<>(); + for(GadgetSet set : _sets) + { + if(set.isPartOfSet(gadget)) hset.add(set); + } + return hset; + } + + public GadgetSet getGadgetSet(Class c) + { + for(GadgetSet set : _sets) + { + if(set.getClass().equals(c)) return set; + } + return null; + } + + private void addSet(GadgetSet set) + { + _sets.add(set); + } + private void addGadget(Gadget gadget) { if (!_gadgets.containsKey(gadget.getGadgetType())) @@ -284,56 +341,6 @@ public class GadgetManager extends MiniPlugin } } } - - /* - public void RemoveItem(Player player) - { - for (GadgetType gadgetType : _gadgets.keySet()) - { - for (Gadget gadget : _gadgets.get(gadgetType)) - { - if (gadget instanceof ItemGadget) - { - ItemGadget item = (ItemGadget) gadget; - - item.RemoveItem(player); - } - } - } - } - - public void RemoveParticle(Player player) - { - for (GadgetType gadgetType : _gadgets.keySet()) - { - for (Gadget gadget : _gadgets.get(gadgetType)) - { - if (gadget instanceof ParticleGadget) - { - ParticleGadget part = (ParticleGadget) gadget; - - part.Disable(player); - } - } - } - } - - public void RemoveMorph(Player player) - { - for (GadgetType gadgetType : _gadgets.keySet()) - { - for (Gadget gadget : _gadgets.get(gadgetType)) - { - if (gadget instanceof MorphGadget) - { - MorphGadget part = (MorphGadget) gadget; - - part.Disable(player); - } - } - } - } - */ public void removeGadetType(Player player, GadgetType type) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetDisableEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetDisableEvent.java new file mode 100644 index 000000000..000eace62 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetDisableEvent.java @@ -0,0 +1,43 @@ +package mineplex.core.gadget.event; + +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +import mineplex.core.gadget.types.Gadget; + +public class GadgetDisableEvent extends Event +{ + + private static final HandlerList handlers = new HandlerList(); + + private Player _player; + private Gadget _gadget; + + public GadgetDisableEvent(Player player, Gadget gadget) + { + _player = player; + _gadget = gadget; + } + + public Player getPlayer() + { + return _player; + } + + public Gadget getGadget() + { + return _gadget; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + + public HandlerList getHandlers() + { + return handlers; + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetActivateEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetEnableEvent.java similarity index 88% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetActivateEvent.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetEnableEvent.java index 913d4860a..05112dfbf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetActivateEvent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetEnableEvent.java @@ -7,16 +7,17 @@ import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; -public class GadgetActivateEvent extends Event +public class GadgetEnableEvent extends Event { private static final HandlerList handlers = new HandlerList(); private Player _player; private Gadget _gadget; + private boolean _cancelled = false; - public GadgetActivateEvent(Player player, Gadget gadget) + public GadgetEnableEvent(Player player, Gadget gadget) { _player = player; _gadget = gadget; @@ -41,7 +42,7 @@ public class GadgetActivateEvent extends Event { return _player; } - + public void setCancelled(boolean cancel) { _cancelled = cancel; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java index 658c25e72..41659abca 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java @@ -15,14 +15,14 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget { public ArrowTrailFrostLord(GadgetManager manager) { - super(manager, "Frost Lord Arrow Trail", new String[] + super(manager, "Arrows of the Frost Lord", new String[] { C.cWhite + "You are a mighty frost lord.", C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", }, 10, - Material.SNOW_BALL, (byte)0); + Material.SNOW_BALL, (byte)0, "Frost Lord"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java index 91cc05ad6..f0e5d5d42 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java @@ -19,7 +19,7 @@ public class DeathFrostLord extends DeathEffectGadget C.cWhite + "are enchanted with snow powers.", }, 10, - Material.SNOW_BALL, (byte)0); + Material.SNOW_BALL, (byte)0, "Frost Lord"); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java index 365d6d1ce..ab1047715 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java @@ -2,27 +2,25 @@ package mineplex.core.gadget.gadgets.doublejump; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.player.PlayerToggleFlightEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.gadget.types.DoubleJumpEffectGadget; +import mineplex.core.common.util.UtilServer; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.DoubleJumpEffectGadget; public class DoubleJumpFrostLord extends DoubleJumpEffectGadget { public DoubleJumpFrostLord(GadgetManager manager) { - super(manager, "Frost Lord Jump Effect", new String[] + super(manager, "Boots of the Frost Lord", new String[] { C.cWhite + "More snow incomming.", }, 1, - Material.SNOW_BALL, (byte)0); + Material.SNOW_BALL, (byte)0, "Frost Lord"); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java new file mode 100644 index 000000000..5a58edd2e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java @@ -0,0 +1,18 @@ +package mineplex.core.gadget.gadgets.hat; + +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; + +import mineplex.core.common.util.C; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.HatGadget; + +public class HatCoal extends HatGadget +{ + + public HatCoal(GadgetManager manager) + { + super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, 10, new ItemStack(Material.COAL_BLOCK)); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java new file mode 100644 index 000000000..393f956b2 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.hat; + +import mineplex.core.common.util.C; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.HatGadget; + +public class HatPresent extends HatGadget +{ + + public HatPresent(GadgetManager manager) + { + super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, 10, "christmasgift"); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java new file mode 100644 index 000000000..618e1005e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.hat; + +import mineplex.core.common.util.C; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.HatGadget; + +public class HatSanta extends HatGadget +{ + + public HatSanta(GadgetManager manager) + { + super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, 10, "Presents"); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java new file mode 100644 index 000000000..69a2ca1f5 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.hat; + +import mineplex.core.common.util.C; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.HatGadget; + +public class HatSnowman extends HatGadget +{ + + public HatSnowman(GadgetManager manager) + { + super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, 10, "snowman002"); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 38ff604cc..b0fae1e93 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -58,17 +58,23 @@ public class ItemCoal extends ItemGadget { if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) { - player.sendMessage(F.main("Coal", "You unlocked " + C.cDGray + "COAL FUMES!")); - UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); - UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); - player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); Manager.getInventoryManager().addItemToInventory(new Callback() { @Override public void run(Boolean data) { - Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); - player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + if(data) + { + player.sendMessage(F.main("Coal", "You unlocked " + C.cDGray + "COAL FUMES!")); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); + player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); + + Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); + player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + } else { + player.sendMessage("Something went wrong..."); + } } }, player, "Coal Fumes", 1); return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java index 2e65b7ae5..6b598c419 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java @@ -19,7 +19,7 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.OutfitGadget; import mineplex.core.gadget.types.OutfitGadget.ArmorSlot; @@ -41,7 +41,7 @@ public class OutfitTeam extends OutfitGadget @Override public void Enable(Player player) { - GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this); + GadgetEnableEvent gadgetEvent = new GadgetEnableEvent(player, this); Bukkit.getServer().getPluginManager().callEvent(gadgetEvent); if (gadgetEvent.isCancelled()) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index 7d7a01928..e01e24201 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -1,28 +1,25 @@ package mineplex.core.gadget.gadgets.particle; import java.util.HashSet; -import java.util.Iterator; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.entity.ProjectileLaunchEvent; -import org.bukkit.event.player.PlayerToggleFlightEvent; -import mineplex.core.blood.BloodEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilServer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.set.SetFrostLord; +import mineplex.core.gadget.types.GadgetSet; import mineplex.core.gadget.types.ParticleGadget; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.gadget.GadgetManager; public class ParticleFrostLord extends ParticleGadget { @@ -30,14 +27,14 @@ public class ParticleFrostLord extends ParticleGadget public ParticleFrostLord(GadgetManager manager) { - super(manager, "Frost Lord Particle", new String[] + super(manager, "Wind of the Frost Lord", new String[] { C.cWhite + "You are a mighty frost lord.", C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", }, 10, - Material.SNOW_BALL, (byte)0); + Material.SNOW_BALL, (byte)0, "Frost Lord"); } @EventHandler @@ -62,12 +59,19 @@ public class ParticleFrostLord extends ParticleGadget double scale = (double)(player.getTicksLived() % 50) / 50d; - for (int i = 0 ; i < 8 ; i++) + int amount = 4; + + GadgetSet set = Manager.getGadgetSet(SetFrostLord.class); + if(set.isActive(player)) amount = 6; + + double ang = Math.PI*2/amount; + + for (int i = 0 ; i < amount ; i++) { double r = (1d-scale) * Math.PI * 2; - double x = Math.sin(r + (i * (Math.PI/4))) * (r%(Math.PI * 4)) * 0.4; - double z = Math.cos(r + (i * (Math.PI/4))) * (r%(Math.PI * 4)) * 0.4; + double x = Math.sin(r + (i * ang)) * (r%(Math.PI * 4)) * 0.4; + double z = Math.cos(r + (i * ang)) * (r%(Math.PI * 4)) * 0.4; UtilParticle.PlayParticle(ParticleType.SNOW_SHOVEL, player.getLocation().add(x, scale * 3, z), 0f, 0f, 0f, 0, 1, ViewDist.NORMAL, UtilServer.getPlayers()); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java index cc4a4882e..26e47dae7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java @@ -1,20 +1,20 @@ package mineplex.core.gadget.gadgets.particle; -import org.bukkit.GameMode; +import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilServer; +import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.ParticleGadget; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.gadget.GadgetManager; public class ParticleHelix extends ParticleGadget { @@ -49,6 +49,56 @@ public class ParticleHelix extends ParticleGadget } else { + + int ticks = 10; + int hticks = 40; + boolean up = player.getTicksLived()%(hticks*2) < hticks; + int tick = player.getTicksLived()%ticks; + double htick = player.getTicksLived()%hticks; + int splits = 4; + + Location loc = player.getLocation().add(0, 2, 0); + + for(double d = tick*(Math.PI*2/splits)/ticks; d < Math.PI*2; d += Math.PI*2/splits) + { + Vector v = new Vector(Math.sin(d), 0, Math.cos(d)); + v.normalize().multiply(Math.max(0.2, Math.sin((htick/hticks)*Math.PI)*1.0)); + v.setY((htick/hticks) * -2); + if(up) v.setY(-2 + 2*(htick/hticks)); + + +// v.multiply(2).subtract(v.clone().multiply(htick/hticks)); +// v.multiply(2*(htick/hticks)); + + Location lloc = loc.clone().add(v); + + UtilParticle.PlayParticleToAll(ParticleType.RED_DUST, lloc, null, 0f, 2, ViewDist.NORMAL); + } + +// UtilParticle.PlayParticle(ParticleType.RED_DUST, player.getLocation().add(0, 0.1, 0), 0.5f, 0.1f, 0.5f, 0, 20, +// ViewDist.NORMAL, UtilServer.getPlayers()); + + /* + * With Flame + int ticks = 10; + int tick = player.getTicksLived()%ticks; + int splits = 3; + + Location loc = player.getLocation().add(0, 3, 0); + + for(double d = tick*(Math.PI*2/splits)/ticks; d < Math.PI*2; d += Math.PI*2/splits) + { + Vector v = new Vector(Math.sin(d), 0, Math.cos(d)); + + v.setY(-1.5); + + UtilParticle.PlayParticleToAll(ParticleType.FLAME, loc, v, 0.1f, 0, ViewDist.NORMAL); + } + + UtilParticle.PlayParticle(ParticleType.RED_DUST, player.getLocation().add(0, 0.1, 0), 0.5f, 0.1f, 0.5f, 0, 20, + ViewDist.NORMAL, UtilServer.getPlayers()); + */ + /* for (int height=0 ; height <= 20 ; height++) { for (int i=0 ; i < 2 ; i++) @@ -73,6 +123,7 @@ public class ParticleHelix extends ParticleGadget //Sound player.getWorld().playSound(player.getLocation(), Sound.LAVA, 0.3f, 1f); + */ } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index 8431e6f7c..12353e872 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -59,8 +59,11 @@ public class ParticleTitan extends ParticleGadget double r = 3; boolean redstone = false; - if(Manager.isMoving(player)) - r = 0.5; + if(Manager.isMoving(player)) + { + UtilParticle.PlayParticleToAll(ParticleType.FLAME, player.getLocation().add(0, 0.1, 0), 0.2f, 0.1f, 0.2f, 0.015f, 3, ViewDist.NORMAL); + continue; + } for(int i = 0; i < total; i++) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java new file mode 100644 index 000000000..ce34dfc65 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java @@ -0,0 +1,38 @@ +package mineplex.core.gadget.set; + +import org.bukkit.entity.Player; + +import mineplex.core.common.util.F; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord; +import mineplex.core.gadget.gadgets.death.DeathFrostLord; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; +import mineplex.core.gadget.gadgets.particle.ParticleFrostLord; +import mineplex.core.gadget.types.GadgetSet; + +public class SetFrostLord extends GadgetSet +{ + + public SetFrostLord(GadgetManager manager) + { + super(manager, + manager.getGadget(ArrowTrailFrostLord.class), + manager.getGadget(DeathFrostLord.class), + manager.getGadget(DoubleJumpFrostLord.class), + manager.getGadget(ParticleFrostLord.class)); + } + + @Override + public void customEnable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Frost Lord"))); + } + + @Override + public void customDisable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Frost Lord"))); + + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java index 596a1e3f7..3513506a9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java @@ -20,9 +20,9 @@ public abstract class ArrowEffectGadget extends Gadget { protected HashSet _arrows = new HashSet(); - public ArrowEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + public ArrowEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, String...altNames) { - super(manager, GadgetType.ArrowTrail, name, desc, cost, mat, data); + super(manager, GadgetType.ArrowTrail, name, desc, cost, mat, data, 1, altNames); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java index 031406193..4e04cb807 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java @@ -9,9 +9,9 @@ import mineplex.core.gadget.GadgetManager; public abstract class DeathEffectGadget extends Gadget { - public DeathEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + public DeathEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, String...altNames) { - super(manager, GadgetType.Death, name, desc, cost, mat, data); + super(manager, GadgetType.Death, name, desc, cost, mat, data, 1, altNames); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java index 84b02523a..59575b97f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java @@ -6,18 +6,14 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerToggleFlightEvent; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; public abstract class DoubleJumpEffectGadget extends Gadget { - public DoubleJumpEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + public DoubleJumpEffectGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, String...altNames) { - super(manager, GadgetType.DoubleJump, name, desc, cost, mat, data); + super(manager, GadgetType.DoubleJump, name, desc, cost, mat, data, 1, altNames); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java index 063495f54..fae816a3f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java @@ -7,7 +7,8 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; +import mineplex.core.gadget.event.GadgetDisableEvent; import mineplex.core.shop.item.SalesPackageBase; import org.bukkit.Bukkit; @@ -25,18 +26,23 @@ public abstract class Gadget extends SalesPackageBase implements Listener protected HashSet _active = new HashSet(); + private String[] _alternativePackageNames; + public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data) { this(manager, gadgetType, name, desc, cost, mat, data, 1); } - public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, int quantity) + public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, int quantity, String... alternativesalepackageNames) { super(name, mat, data, desc, cost, quantity); _gadgetType = gadgetType; KnownPackage = false; + _alternativePackageNames = alternativesalepackageNames; + if(_alternativePackageNames == null) _alternativePackageNames = new String[0]; + Manager = manager; Manager.getPlugin().getServer().getPluginManager().registerEvents(this, Manager.getPlugin()); @@ -65,7 +71,7 @@ public abstract class Gadget extends SalesPackageBase implements Listener public void Enable(Player player) { - GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this); + GadgetEnableEvent gadgetEvent = new GadgetEnableEvent(player, this); Bukkit.getServer().getPluginManager().callEvent(gadgetEvent); if (gadgetEvent.isCancelled()) @@ -89,7 +95,11 @@ public abstract class Gadget extends SalesPackageBase implements Listener public void Disable(Player player) { if (IsActive(player)) + { Manager.removeActive(player, this); + GadgetDisableEvent event = new GadgetDisableEvent(player, this); + Bukkit.getServer().getPluginManager().callEvent(event); + } DisableCustom(player); } @@ -102,6 +112,21 @@ public abstract class Gadget extends SalesPackageBase implements Listener { } + + public boolean ownsGadget(Player player) + { + if(IsFree()) return true; + if(Manager.getDonationManager().Get(player.getName()).OwnsUnknownPackage(GetName())) return true; + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) > 0) return true; + + for(String alt : _alternativePackageNames) + { + if(Manager.getDonationManager().Get(player.getName()).OwnsUnknownPackage(alt)) return true; + if(Manager.getInventoryManager().Get(player).getItemCount(alt) > 0) return true; + } + + return false; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java new file mode 100644 index 000000000..94e7dde71 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java @@ -0,0 +1,93 @@ +package mineplex.core.gadget.types; + +import java.util.HashSet; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.event.GadgetEnableEvent; +import mineplex.core.gadget.event.GadgetDisableEvent; + +public abstract class GadgetSet implements Listener +{ + + private Gadget[] _gadgets; + + protected GadgetManager Manager; + + HashSet _active = new HashSet<>(); + + public GadgetSet(GadgetManager manager, Gadget... gadgets) + { + Manager = manager; + _gadgets = gadgets; + + Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin()); + } + + public void checkPlayer(Player player, Gadget gadget, boolean enable) + { + boolean wasActive = isActive(player); + + for(Gadget g : _gadgets) + { + if(!g.IsActive(player) || g.equals(gadget)) + { + if(enable && g.equals(gadget)) continue; + + _active.remove(player); + if(wasActive) customDisable(player); + return; + } + } + _active.add(player); + if(!wasActive) + { + customEnable(player); + } + } + + @EventHandler + public void onActivate(GadgetEnableEvent event) + { + checkPlayer(event.getPlayer(), event.getGadget(), true); + } + + @EventHandler + public void onDeativate(GadgetDisableEvent event) + { + checkPlayer(event.getPlayer(), event.getGadget(), false); + } + + public boolean isActive(Player player) + { + return _active.contains(player); + } + + public abstract void customEnable(Player player); + + + public abstract void customDisable(Player player); + + public Gadget[] getGadgets() + { + Gadget[] array = new Gadget[_gadgets.length]; + System.arraycopy(_gadgets, 0, array, 0, array.length); + return array; + } + + public boolean isPartOfSet(Gadget gadget) + { + for(Gadget g : _gadgets) + { + if(g.equals(gadget)) return true; + } + return false; + } + + + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java new file mode 100644 index 000000000..e7ad0ea37 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java @@ -0,0 +1,92 @@ +package mineplex.core.gadget.types; + +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.SkullMeta; + +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.gadget.GadgetManager; + +public abstract class HatGadget extends OutfitGadget +{ + + private ItemStack _hat; + + public HatGadget(GadgetManager manager, String name, String[] desc, int cost, ItemStack item) + { + super(manager, name, desc, cost, ArmorSlot.Helmet, item.getType(), item.getData().getData()); + _hat = item; + } + + public HatGadget(GadgetManager manager, String name, String[] desc, int cost, String playerName) + { + this(manager, name, desc, cost, getSkull(playerName)); + } + + public ItemStack getHelmetItem() + { + return _hat.clone(); + } + + public void ApplyArmor(Player player) + { + Manager.removeGadetType(player, GadgetType.Morph); + + Manager.RemoveOutfit(player, _slot); + + _active.add(player); + + UtilPlayer.message(player, F.main("Gadget", "You put on " + F.elem(GetName()) + ".")); + + player.getInventory().setHelmet(getHelmetItem()); + } + + public void RemoveArmor(Player player) + { + if (!_active.remove(player)) + return; + + UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(GetName()) + ".")); + + player.getInventory().setHelmet(null); + } + + public static ItemStack getSkull(String playerName) + { + SkullMeta meta = (SkullMeta) Bukkit.getItemFactory().getItemMeta(Material.SKULL_ITEM); + + meta.setOwner(playerName); + + ItemStack stack = new ItemStack(Material.SKULL_ITEM,1 , (byte)3); + + stack.setItemMeta(meta); + + return stack; + } + + @Override + public GadgetType getGadgetType() + { + return GadgetType.Hat; + } + + + @Override + public void EnableCustom(Player player) + { + ApplyArmor(player); + } + + @Override + public void DisableCustom(Player player) + { + RemoveArmor(player); + } + + + + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MusicGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MusicGadget.java index 7dd175be3..c139e85c8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MusicGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MusicGadget.java @@ -8,7 +8,7 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.event.GadgetBlockEvent; import mineplex.core.gadget.gadgets.SongData; import mineplex.core.recharge.Recharge; @@ -41,7 +41,7 @@ public class MusicGadget extends Gadget @Override public void Enable(Player player) { - GadgetActivateEvent gadgetEvent = new GadgetActivateEvent(player, this); + GadgetEnableEvent gadgetEvent = new GadgetEnableEvent(player, this); Bukkit.getServer().getPluginManager().callEvent(gadgetEvent); if (gadgetEvent.isCancelled()) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java index 499972786..24444a965 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java @@ -9,9 +9,9 @@ import mineplex.core.gadget.GadgetManager; public abstract class ParticleGadget extends Gadget { - public ParticleGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data) + public ParticleGadget(GadgetManager manager, String name, String[] desc, int cost, Material mat, byte data, String...altNames) { - super(manager, GadgetType.Particle, name, desc, cost, mat, data); + super(manager, GadgetType.Particle, name, desc, cost, mat, data, 1, altNames); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java index 5b7237994..f10a8db0d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java @@ -15,7 +15,7 @@ import mineplex.core.common.util.UUIDFetcher; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.disguises.DisguisePlayer; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.types.GadgetType; import mineplex.core.treasure.event.TreasureStartEvent; import mineplex.core.updater.UpdateType; @@ -291,7 +291,7 @@ public class DisguiseCommand extends CommandBase implements Liste } @EventHandler - public void gadget(GadgetActivateEvent event) + public void gadget(GadgetEnableEvent event) { if(!event.getGadget().GetName().equalsIgnoreCase("Coin Party Bomb") && event.getGadget().getGadgetType() != GadgetType.Morph) return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java index 31e1a164a..58f1e3b2b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/event/EventGame.java @@ -25,7 +25,7 @@ import mineplex.core.disguise.disguises.DisguiseBat; import mineplex.core.disguise.disguises.DisguiseChicken; import mineplex.core.disguise.disguises.DisguiseEnderman; import mineplex.core.disguise.disguises.DisguiseWither; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.give.Give; @@ -298,7 +298,7 @@ public class EventGame extends Game } @EventHandler - public void gadgetActivate(GadgetActivateEvent event) + public void gadgetActivate(GadgetEnableEvent event) { if (!_gadgetsEnabled) event.setCancelled(true); @@ -459,7 +459,7 @@ public class EventGame extends Game } @EventHandler - public void gadgetDisable(GadgetActivateEvent event) + public void gadgetDisable(GadgetEnableEvent event) { if (_allowAllGadgets) return; @@ -931,7 +931,7 @@ public class EventGame extends Game } @EventHandler - public void activateGadget(GadgetActivateEvent event) + public void activateGadget(GadgetEnableEvent event) { for(EventArea area : _customAreas.values()) { From 5b0909012d1388b5bc19e1e77fe1e29414d0ec0a Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Fri, 11 Dec 2015 01:07:47 +0100 Subject: [PATCH 07/51] Renamed GadgetActivateEvent to GadgetEnable event Some files didn't make it to prev commit --- Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java | 4 ++-- .../src/mineplex/hub/commands/DisguiseCommand.java | 4 ++-- .../Mineplex.Hub/src/mineplex/hub/modules/KothManager.java | 4 ++-- .../src/mineplex/hub/modules/ParkourManager.java | 6 +++--- .../src/mineplex/hub/modules/SoccerManager.java | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index ad5f421a0..7d6414188 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -28,7 +28,7 @@ import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.disguises.DisguiseSlime; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.gadget.types.GadgetType; import mineplex.core.giveaway.GiveawayManager; @@ -949,7 +949,7 @@ public class HubManager extends MiniClientPlugin } @EventHandler - public void GadgetActivate(GadgetActivateEvent event) + public void GadgetActivate(GadgetEnableEvent event) { if (!_gadgetsEnabled) event.setCancelled(true); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java index cc55696c8..2255c8a89 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java @@ -16,7 +16,7 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.donation.Donor; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.treasure.event.TreasureStartEvent; @@ -285,7 +285,7 @@ public class DisguiseCommand extends CommandBase implements Listener } @EventHandler - public void gadget(GadgetActivateEvent event) + public void gadget(GadgetEnableEvent event) { if(!event.getGadget().GetName().equalsIgnoreCase("Coin Party Bomb") && event.getGadget().getGadgetType() != GadgetType.Morph) return; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java index 6f69a5782..d45cb3c8d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/KothManager.java @@ -22,7 +22,7 @@ import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.gadgets.item.ItemDuelingSword; import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.types.Gadget; @@ -214,7 +214,7 @@ public class KothManager extends MiniPlugin } @EventHandler - public void disableGadgets(GadgetActivateEvent event) + public void disableGadgets(GadgetEnableEvent event) { if (isKothMode(event.getPlayer())) event.setCancelled(true); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java index 2b4b198d3..b5d86f0d6 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java @@ -36,7 +36,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.donation.DonationManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.event.GadgetBlockEvent; import mineplex.core.gadget.types.MusicGadget; import mineplex.core.mount.event.MountActivateEvent; @@ -138,7 +138,7 @@ public class ParkourManager extends MiniPlugin } @EventHandler - public void disableGadgets(GadgetActivateEvent event) + public void disableGadgets(GadgetEnableEvent event) { if (isParkourMode(event.getPlayer())) event.setCancelled(true); @@ -460,7 +460,7 @@ public class ParkourManager extends MiniPlugin } @EventHandler - public void musicDisable(GadgetActivateEvent event) + public void musicDisable(GadgetEnableEvent event) { if (event.getGadget() instanceof MusicGadget) { diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index 687bf534c..b33dadd43 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -41,7 +41,7 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.GadgetActivateEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; @@ -491,7 +491,7 @@ public class SoccerManager extends MiniPlugin } @EventHandler - public void disableGadgets(GadgetActivateEvent event) + public void disableGadgets(GadgetEnableEvent event) { if (isSoccerMode(event.getPlayer())) event.setCancelled(true); From 7b4f5d5b752f53f9d90e4ec38899644fb083f346 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 19:19:20 -0500 Subject: [PATCH 08/51] Christmas chest in gui --- .../core/treasure/gui/TreasurePage.java | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) 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 f1426accf..a4823f5d2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -39,6 +39,7 @@ public class TreasurePage extends ShopPageBase int basicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.OLD.getItemName()); int heroicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ANCIENT.getItemName()); int legendaryCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MYTHICAL.getItemName()); + int christmasCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.CHRISTMAS.getItemName()); List basicLore = new ArrayList(); basicLore.add(" "); @@ -97,17 +98,41 @@ public class TreasurePage extends ShopPageBase legendaryLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } + List christmasLore = new ArrayList(); + christmasLore.add(" "); + christmasLore.add(F.value("Christmas Chests Owned", "" + christmasCount)); + christmasLore.add(" "); + christmasLore.add(C.cGray + "All our previous adventurers have"); + christmasLore.add(C.cGray + "perished in search of these chests."); + christmasLore.add(C.cGray + "However, legends of their existence"); + christmasLore.add(C.cGray + "convinced Sterling, Chiss and Defek7"); + christmasLore.add(C.cGray + "to venture out and discover the"); + christmasLore.add(C.cGray + "location of these chests on their own."); + christmasLore.add(" "); + if (christmasCount > 0) + christmasLore.add(ChatColor.RESET + C.cGreen + "Click to Open!"); + else + { + christmasLore.add(ChatColor.RESET + "Click to Purchase for " + C.cYellow + "10000 Coins"); + christmasLore.add(" "); + christmasLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); + } + ShopItem basic = new ShopItem(Material.CHEST, C.cGreen + C.Bold + "Old Chest", basicLore.toArray(new String[0]), 0, false, false); ShopItem heroic = new ShopItem(Material.TRAPPED_CHEST, C.cGold + C.Bold + "Ancient Chest", heroicLore.toArray(new String[0]), 0, false, false); ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Chest", legendaryLore.toArray(new String[0]), 0, false, false); + ShopItem christmas = new ShopItem(Material.SNOW_BALL, C.cAqua + C.Bold + "Christmas Chest", christmasLore.toArray(new String[0]), 0, false, false); - if (basicCount > 0) addButton(2, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD)); - else addButton(2, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000)); + if (basicCount > 0) addButton(1, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD)); + else addButton(1, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000)); - if (heroicCount > 0) addButton(4, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT)); - else addButton(4, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000)); + if (heroicCount > 0) addButton(3, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT)); + else addButton(3, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000)); - if (legendaryCount > 0) addButton(6, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL)); - else addButton(6, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000)); + if (legendaryCount > 0) addButton(5, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL)); + else addButton(5, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000)); + + if (christmasCount > 0) addButton(6, christmas, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.CHRISTMAS)); + else addButton(6, christmas, new BuyChestButton(getPlayer(), _inventoryManager, this, "Christmas Chest", Material.SNOW_BALL, 10000)); } } From 5d96ceb41ee7b1eeaca90456906bd6a58b0e576f Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 19:20:11 -0500 Subject: [PATCH 09/51] Let owner+ disguise as staff - easy way to check a player's rank --- .../src/mineplex/hub/commands/DisguiseCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java index cc55696c8..4f7e3aa8e 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java @@ -111,6 +111,8 @@ public class DisguiseCommand extends CommandBase implements Listener return; } + final Rank rank = Plugin.GetClients().Get(caller).GetRank(); + Bukkit.getServer().getScheduler().runTaskAsynchronously(Plugin.getPlugin(), new Runnable() { @Override @@ -162,7 +164,7 @@ public class DisguiseCommand extends CommandBase implements Listener otherRank = other.GetRank(); } catch(NullPointerException exception) {} - if(otherRank.has(Rank.TWITCH)) + if(otherRank.has(Rank.TWITCH) && !rank.has(Rank.OWNER)) { UtilPlayer.message(caller, C.cRed + C.Bold + "You can't disguise as staff!"); return; From 4d8b8bd58bb1aca419124a70af21c84c96609892 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 19:27:32 -0500 Subject: [PATCH 10/51] Fix errors, update cosmetic menu --- .../mineplex/core/cosmetic/ui/page/Menu.java | 41 ++++++------------- .../mineplex/core/gadget/GadgetManager.java | 4 +- .../src/mineplex/hub/HubManager.java | 6 +-- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index 143794f24..a0ecf9001 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -53,37 +53,20 @@ public class Menu extends ShopPageBase // " " // }, 1, false)); - - addItem(4, new ShopItem(175, getDonationManager().Get(getPlayer().getName()).getCoins() + " Coins", new String[] - { - " ", - ChatColor.RESET + C.cYellow + "Purchase Coins", - ChatColor.RESET + "www.mineplex.com/shop", - " ", - ChatColor.RESET + C.cAqua + "Ultra Rank", - ChatColor.RESET + "Receives 7500 Coins per Month", - " ", - ChatColor.RESET + C.cPurple + "Hero Rank", - ChatColor.RESET + "Receives 15000 Coins per Month", - " ", - ChatColor.RESET + C.cGreen + "Legend Rank", - ChatColor.RESET + "Receives 30000 Coins per Month" - }, 1, false)); - - addButton(10, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this)); - addButton(12, new ShopItem(Material.ARROW, "Arrow Trails", 1, false), new OpenArrowTrails(this)); - addButton(14, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", 1, false), new OpenDoubleJump(this)); - addButton(16, new ShopItem(Material.SKULL_ITEM, "Death Animations", 1, false), new OpenDeathAnimations(this)); + addButton(1, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this)); + addButton(3, new ShopItem(Material.ARROW, "Arrow Trails", 1, false), new OpenArrowTrails(this)); + addButton(5, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", 1, false), new OpenDoubleJump(this)); + addButton(7, new ShopItem(Material.SKULL_ITEM, "Death Animations", 1, false), new OpenDeathAnimations(this)); - addButton(28, new ShopItem(Material.MELON_BLOCK, "Gadgets", 1, false), new OpenGadgets(this)); - addButton(30, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this)); - addButton(32, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this)); - addButton(34, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this)); + addButton(19, new ShopItem(Material.MELON_BLOCK, "Gadgets", 1, false), new OpenGadgets(this)); + addButton(21, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this)); + addButton(23, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this)); + addButton(25, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this)); - addButton(46, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this)); - addButton(48, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); - addButton(50, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); - addButton(52, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton() + addButton(37, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this)); + addButton(39, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); + addButton(42, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); + addButton(44, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton() { @Override public void onClick(Player player, ClickType clickType) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 1c6de2bb4..4f1852000 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -30,8 +30,8 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.DisguiseManager; import mineplex.core.donation.DonationManager; -import mineplex.core.gadget.event.GadgetActivateEvent; import mineplex.core.gadget.event.GadgetCollideEntityEvent; +import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord; import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan; @@ -578,7 +578,7 @@ public class GadgetManager extends MiniPlugin } @EventHandler - public void GadgetActivate(GadgetActivateEvent event) + public void GadgetActivate(GadgetEnableEvent event) { if (!_gadgetsEnabled) event.setCancelled(true); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index d9673ed0b..6eaf1149a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -234,7 +234,7 @@ public class HubManager extends MiniClientPlugin _achievementManager.setGiveInterfaceItem(true); _packetHandler = packetHandler; - new NotificationManager(getPlugin(), clientManager); + new NotificationManager(getPlugin(), clientManager, _preferences); new BotSpamManager(plugin, clientManager, punish); ((CraftWorld)Bukkit.getWorlds().get(0)).getHandle().pvpMode = true; @@ -933,7 +933,7 @@ public class HubManager extends MiniClientPlugin GetGadget().toggleGadgetEnabled(); for (Player player : UtilServer.getPlayers()) - player.sendMessage(C.cWhite + C.Bold + "Gadgets/Mounts are now " + F.elem(_gadgetsEnabled ? C.cGreen + C.Bold + "Enabled" : C.cRed + C.Bold + "Disabled")); + player.sendMessage(C.cWhite + C.Bold + "Gadgets/Mounts are now " + F.elem(GetGadget().isGadgetEnabled() ? C.cGreen + C.Bold + "Enabled" : C.cRed + C.Bold + "Disabled")); } public void addGameMode(Player caller, Player target) @@ -1007,7 +1007,7 @@ public class HubManager extends MiniClientPlugin } @EventHandler - public void disableMusicChristmas(GadgetActivateEvent event) + public void disableMusicChristmas(GadgetEnableEvent event) { if (event.getGadget() != null && event.getGadget().getGadgetType() == GadgetType.MusicDisc) { From 16f39c1e712445f17769d86f2fa34ad9960159cf Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 20:51:34 -0500 Subject: [PATCH 11/51] Pushing changes to go help william --- .../src/mineplex/core/common/util/F.java | 5 +++ .../mineplex/core/cosmetic/ui/page/Menu.java | 30 +++++++------- .../core/treasure/TreasureManager.java | 7 ++++ .../mineplex/core/treasure/TreasureType.java | 2 +- .../core/treasure/gui/TreasurePage.java | 39 +++++++++++++------ 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/F.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/F.java index db1e528f3..fd2a34ec6 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/F.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/F.java @@ -106,6 +106,11 @@ public class F return rank.getTag(false, false); } + public static String value(String variable, int value) + { + return value(variable, "" + value); + } + public static String value(String variable, String value) { return value(0, variable, value); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index a0ecf9001..3d213582d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -65,8 +65,8 @@ public class Menu extends ShopPageBase addButton(37, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this)); addButton(39, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); - addButton(42, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); - addButton(44, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton() + addButton(41, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); + addButton(43, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton() { @Override public void onClick(Player player, ClickType clickType) @@ -84,37 +84,37 @@ public class Menu extends ShopPageBase switch (type) { case Particle: - slot = 10; + slot = 1; break; case ArrowTrail: - slot = 12; + slot = 3; break; case DoubleJump: - slot = 14; + slot = 5; break; case Death: - slot = 16; + slot = 7; break; case Item: - slot = 28; + slot = 19; break; case Morph: - slot = 30; + slot = 21; break; case Hat: - slot = 46; + slot = 37; break; case Costume: - slot = 48; + slot = 39; break; case MusicDisc: - slot = 50; + slot = 41; break; case Taunt: - slot = 52; + slot = 43; break; default: - slot = 10; + slot = 1; break; } slot += 9; @@ -134,7 +134,7 @@ public class Menu extends ShopPageBase { final Mount mount = getPlugin().getMountManager().getActive(getPlayer()); - addButton(32 + 9, + addButton(23 + 9, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), C.mItem + mount.GetName(), new String[0], 1, false, false), new IButton() { @@ -151,7 +151,7 @@ public class Menu extends ShopPageBase { Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName()); String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName(); - addButton(34 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false), + addButton(25 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false), new IButton() { public void onClick(Player player, ClickType clickType) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java index c37885de1..935b772c5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureManager.java @@ -29,6 +29,7 @@ import mineplex.core.status.ServerStatusManager; */ public class TreasureManager extends MiniPlugin { + private CoreClientManager _clientManager; private RewardManager _rewardManager; private InventoryManager _inventoryManager; private BlockRestore _blockRestore; @@ -40,6 +41,7 @@ public class TreasureManager extends MiniPlugin { super("Treasure", plugin); + _clientManager = clientManager; _inventoryManager = inventoryManager; _blockRestore = blockRestore; _hologramManager = hologramManager; @@ -155,4 +157,9 @@ public class TreasureManager extends MiniPlugin { return _blockRestore; } + + public CoreClientManager getClientManager() + { + return _clientManager; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java index ab8660490..39566892d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/TreasureType.java @@ -13,7 +13,7 @@ public enum TreasureType MYTHICAL(C.cRed + "Mythical Chest", "Mythical Chest", "Mythical", RewardType.MythicalChest, Material.ENDER_CHEST, TreasureStyle.MYTHICAL), - CHRISTMAS(C.cAqua + "Christmas Chest", "Christmas Chest", "Christmas", RewardType.MythicalChest, Material.CHEST, TreasureStyle.CHRISTMAS); + CHRISTMAS(C.cDGreen + "Winter Holiday Chest", "Winter Chest", "Christmas", RewardType.MythicalChest, Material.CHEST, TreasureStyle.CHRISTMAS); private final String _name; private final RewardType _rewardType; 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 a4823f5d2..a466fb6f2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -6,10 +6,12 @@ import java.util.List; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilSkull; import mineplex.core.donation.DonationManager; import mineplex.core.inventory.InventoryManager; import mineplex.core.shop.item.ShopItem; @@ -25,7 +27,7 @@ public class TreasurePage extends ShopPageBase public TreasurePage(TreasureManager plugin, TreasureShop shop, TreasureLocation treasureLocation, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager, Player player) { - super(plugin, shop, clientManager, donationManager, "Open Treasure", player, 9); + super(plugin, shop, clientManager, donationManager, "Open Treasure", player, 54); _treasureLocation = treasureLocation; _inventoryManager = inventoryManager; @@ -36,11 +38,21 @@ public class TreasurePage extends ShopPageBase @Override protected void buildPage() { + int treasureShards = getDonationManager().Get(getPlayer()).getCoins(); + int basicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.OLD.getItemName()); int heroicCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.ANCIENT.getItemName()); int legendaryCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.MYTHICAL.getItemName()); int christmasCount = _inventoryManager.Get(getPlayer()).getItemCount(TreasureType.CHRISTMAS.getItemName()); + List shardLore = new ArrayList(); + shardLore.add(" "); + shardLore.add(F.value("Treasure Shards", "" + treasureShards)); + shardLore.add(" "); + shardLore.add(C.cGray + "Useless by itself, Treasure Shards"); + shardLore.add(C.cGray + "can be combined to forge new"); + shardLore.add(C.cGray + "and undiscovered treasures."); + List basicLore = new ArrayList(); basicLore.add(" "); basicLore.add(F.value("Old Chests Owned", "" + basicCount)); @@ -118,21 +130,24 @@ public class TreasurePage extends ShopPageBase christmasLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } + ShopItem shards = new ShopItem(Material.PRISMARINE_SHARD, C.cAqua + C.Bold + "Treasure Shards", shardLore.toArray(new String[0]), 0, false); ShopItem basic = new ShopItem(Material.CHEST, C.cGreen + C.Bold + "Old Chest", basicLore.toArray(new String[0]), 0, false, false); ShopItem heroic = new ShopItem(Material.TRAPPED_CHEST, C.cGold + C.Bold + "Ancient Chest", heroicLore.toArray(new String[0]), 0, false, false); ShopItem legendary = new ShopItem(Material.ENDER_CHEST, C.cRed + C.Bold + "Mythical Chest", legendaryLore.toArray(new String[0]), 0, false, false); - ShopItem christmas = new ShopItem(Material.SNOW_BALL, C.cAqua + C.Bold + "Christmas Chest", christmasLore.toArray(new String[0]), 0, false, false); + ItemStack christmas = UtilSkull.getPlayerHead("MHF_Present2", C.cDGreen + C.Bold + "Winter Holiday Chest", christmasLore); - if (basicCount > 0) addButton(1, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD)); - else addButton(1, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000)); - - if (heroicCount > 0) addButton(3, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT)); - else addButton(3, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000)); - - if (legendaryCount > 0) addButton(5, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL)); - else addButton(5, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000)); + addItem(40, shards); - if (christmasCount > 0) addButton(6, christmas, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.CHRISTMAS)); - else addButton(6, christmas, new BuyChestButton(getPlayer(), _inventoryManager, this, "Christmas Chest", Material.SNOW_BALL, 10000)); + if (basicCount > 0) addButton(20, basic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.OLD)); + else addButton(20, basic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Old Chest", Material.CHEST, 1000)); + + if (heroicCount > 0) addButton(22, heroic, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.ANCIENT)); + else addButton(22, heroic, new BuyChestButton(getPlayer(), _inventoryManager, this, "Ancient Chest", Material.CHEST, 5000)); + + if (legendaryCount > 0) addButton(24, legendary, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.MYTHICAL)); + else addButton(24, legendary, new BuyChestButton(getPlayer(), _inventoryManager, this, "Mythical Chest", Material.ENDER_CHEST, 10000)); + + if (christmasCount > 0) addButton(4, christmas, new OpenTreasureButton(getPlayer(), _treasureLocation, TreasureType.CHRISTMAS)); + else addButton(4, christmas, new BuyChestButton(getPlayer(), _inventoryManager, this, "Winter Holiday Chest", Material.SNOW_BALL, 10000)); } } From 31cea3342e027ca591b4c022060bac278ea7eb0f Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 13:17:38 +1100 Subject: [PATCH 12/51] some gadget stuff --- .../core/cosmetic/ui/page/GadgetPage.java | 23 +++++++++++------ .../arrowtrail/ArrowTrailCandyCane.java | 2 +- .../arrowtrail/ArrowTrailFrostLord.java | 2 +- .../gadgets/arrowtrail/ArrowTrailTitan.java | 2 +- .../gadget/gadgets/death/DeathCandyCane.java | 2 +- .../gadget/gadgets/death/DeathFrostLord.java | 2 +- .../core/gadget/gadgets/death/DeathTitan.java | 2 +- .../doublejump/DoubleJumpCandyCane.java | 2 +- .../doublejump/DoubleJumpFrostLord.java | 2 +- .../gadgets/doublejump/DoubleJumpTitan.java | 2 +- .../core/gadget/gadgets/hat/HatCoal.java | 2 +- .../core/gadget/gadgets/hat/HatPresent.java | 2 +- .../core/gadget/gadgets/hat/HatSanta.java | 2 +- .../core/gadget/gadgets/hat/HatSnowman.java | 2 +- .../core/gadget/gadgets/item/ItemCoal.java | 6 ++--- .../gadget/gadgets/item/ItemFreezeCannon.java | 4 +-- .../gadget/gadgets/item/ItemPartyPopper.java | 25 ++++++++++--------- .../gadget/gadgets/item/ItemSnowball.java | 4 +-- .../gadget/gadgets/morph/MorphSnowman.java | 2 +- .../core/gadget/gadgets/morph/MorphTitan.java | 5 +--- .../gadgets/particle/ParticleCandyCane.java | 2 +- .../gadgets/particle/ParticleFrostLord.java | 4 +-- .../gadgets/particle/ParticleLegend.java | 2 +- .../gadgets/particle/ParticleTitan.java | 2 +- .../core/mount/types/MountBabyReindeer.java | 2 +- 25 files changed, 56 insertions(+), 51 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 317f6503c..d94654926 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import net.md_5.bungee.api.ChatColor; + import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -83,22 +85,29 @@ public class GadgetPage extends ShopPageBase List itemLore = new ArrayList(); + + itemLore.add(C.cBlack); + itemLore.addAll(Arrays.asList(gadget.GetDescription())); + if (gadget.GetCost(CurrencyType.Coins) >= 0) { - itemLore.add(C.cYellow + gadget.GetCost(CurrencyType.Coins) + " Coins"); + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Cost: " + ChatColor.RESET + gadget.GetCost(CurrencyType.Coins) + " Treasure Shards"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -1) + { + //Nothing } else if (gadget.GetCost(CurrencyType.Coins) == -2) { - itemLore.add(C.cGold + "Found in Treasure Chests."); + itemLore.add(C.cBlack); + itemLore.add(C.cGray + "Found in Treasure Chests"); } else if (gadget.GetCost(CurrencyType.Coins) == -3) { - + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Found in Winter Holiday Treasure Chests"); } - - - itemLore.add(C.cBlack); - itemLore.addAll(Arrays.asList(gadget.GetDescription())); if (gadget instanceof ItemGadget) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java index 1b9741cfe..85cb085d6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java @@ -21,7 +21,7 @@ public class ArrowTrailCandyCane extends ArrowEffectGadget { C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".", }, - 1, + -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java index 41659abca..020cac190 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java @@ -21,7 +21,7 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", }, - 10, + -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java index 534d7f3b0..051684e25 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java @@ -26,7 +26,7 @@ public class ArrowTrailTitan extends ArrowEffectGadget " ", C.cRed + "Unlocked with Titan Rank", }, - -3, + -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java index 524b45244..8a82b7519 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java @@ -21,7 +21,7 @@ public class DeathCandyCane extends DeathEffectGadget C.cWhite + "COLORS FTW!", C.cWhite + "Take damage with SWAG B)", }, - 10, + -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java index f0e5d5d42..2896ca7af 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java @@ -18,7 +18,7 @@ public class DeathFrostLord extends DeathEffectGadget C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", }, - 10, + -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java index e7f205cf6..fe8dc0982 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java @@ -22,7 +22,7 @@ public class DeathTitan extends DeathEffectGadget " ", C.cRed + "Unlocked with Titan Rank", }, - -3, + -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java index 090963762..8a4e17a29 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java @@ -20,7 +20,7 @@ public class DoubleJumpCandyCane extends DoubleJumpEffectGadget { C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".", }, - 1, + -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java index ab1047715..d40c8388d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java @@ -19,7 +19,7 @@ public class DoubleJumpFrostLord extends DoubleJumpEffectGadget { C.cWhite + "More snow incomming.", }, - 1, + -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java index ed418db96..7749ce217 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -27,7 +27,7 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget " ", C.cRed + "Unlocked with Titan Rank", }, - -3, + -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java index 5a58edd2e..4bc85b096 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java @@ -12,7 +12,7 @@ public class HatCoal extends HatGadget public HatCoal(GadgetManager manager) { - super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, 10, new ItemStack(Material.COAL_BLOCK)); + super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, -3, new ItemStack(Material.COAL_BLOCK)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java index 393f956b2..41f74c93e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java @@ -9,7 +9,7 @@ public class HatPresent extends HatGadget public HatPresent(GadgetManager manager) { - super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, 10, "christmasgift"); + super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, -3, "christmasgift"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java index 618e1005e..f2fa35bbc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java @@ -9,7 +9,7 @@ public class HatSanta extends HatGadget public HatSanta(GadgetManager manager) { - super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, 10, "Presents"); + super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, -3, "Presents"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java index 69a2ca1f5..209d78015 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java @@ -9,7 +9,7 @@ public class HatSnowman extends HatGadget public HatSnowman(GadgetManager manager) { - super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, 10, "snowman002"); + super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, -3, "snowman002"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index b0fae1e93..4d5c06203 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -45,12 +45,12 @@ public class ItemCoal extends ItemGadget C.cDGray + "Exclusive Coal!", C.cDGray + "Earned by beeing naughty" } - , -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] + , 1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] { C.cDGray + "Exclusive Coal!", C.cDGray + "Earned by beeing naughty" } - , 100, 100)); + , 1, 1)); } @Override @@ -65,7 +65,7 @@ public class ItemCoal extends ItemGadget { if(data) { - player.sendMessage(F.main("Coal", "You unlocked " + C.cDGray + "COAL FUMES!")); + player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Fumes" + C.cGray + ".")); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java index d8ac3177e..c630f69cb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java @@ -51,10 +51,10 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown { C.cWhite + "Freeze your nemesis inside a block of ice!" } - , -1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[] + , 1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[] { C.cWhite + "100 Ice Blocks for you to launch!" - }, 500, 100)); + }, -1, 1)); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java index 2a44e16da..2338a8424 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -9,6 +9,7 @@ import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAction; @@ -33,29 +34,29 @@ public class ItemPartyPopper extends ItemGadget implements IThrown super(manager, "Confetti Bomb", new String[] { C.cWhite + "POP BANG!", - }, -1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "100 Party Poppers", Material.DIAMOND_BARDING, + }, 1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "1 Party Popper", Material.GOLDEN_CARROT, (byte) 0, new String[] { C.cWhite + "100 Party Poppers for you to shoot!" - }, 500, 100)); + }, -2, 1)); } @Override public void ActivateCustom(Player player) { - Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), - ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random())); +// Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), +// ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random())); +// +// UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false); +// +// Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); - UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false); - Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); - - /* for(int data : new int[]{1,2,4,5,6,9,10,11,12,13,14,15}) { UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), null, 0.4f, 50, ViewDist.LONG); - /* + for(int i = 0; i < 10; i++) { Vector v = new Vector(Math.random() - 0.5, Math.random() - 0.3, Math.random() - 0.5); @@ -67,7 +68,7 @@ public class ItemPartyPopper extends ItemGadget implements IThrown UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), v, 1, 0, ViewDist.LONG); } - /* + Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)data, 1, "Ink" + Math.random())); _items.add(ent); @@ -79,8 +80,8 @@ public class ItemPartyPopper extends ItemGadget implements IThrown UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.3).add(random), 1 + 0.4 * Math.random(), false, 0, 0.2, 10, false); Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); - */ -// } + + } // Sound for(int i = 0; i < 3; i++) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java index ce1f5dc79..8c5a232d3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java @@ -29,11 +29,11 @@ public class ItemSnowball extends ItemGadget C.cWhite + "Throw snowball!", C.cWhite + "Start epic snowfights!" } - , -1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "50 Snowballs", Material.SNOW_BALL, (byte) 0, new String[] + , 1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "1 Snowball", Material.SNOW_BALL, (byte) 0, new String[] { C.cWhite + "50 Snowballs for you to throw!" } - , 100, 50)); + , -3, 1)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java index 40a7ff8cd..4451b7b72 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java @@ -42,7 +42,7 @@ public class MorphSnowman extends MorphGadget super(manager, "Snowman Morph", new String[]{ C.cWhite + "Do you wanna build a snowman?", C.cWhite + "It doesn't have to be a snowman...", C.cWhite + "Or... it kind of does...", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Snowball", }, - 6000, Material.SNOW_BALL, (byte) 0); + -3, Material.SNOW_BALL, (byte) 0); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java index 1e36b454e..213332edf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java @@ -9,9 +9,7 @@ import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; -import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; @@ -19,7 +17,6 @@ import org.bukkit.util.Vector; import mineplex.core.common.Rank; import mineplex.core.common.util.C; -import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; @@ -54,7 +51,7 @@ public class MorphTitan extends MorphGadget C.cRed + "Unlocked with Titan Rank", }, -1, - Material.PRISMARINE_SHARD, (byte)0); + Material.PRISMARINE_CRYSTALS, (byte)0); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java index 110cbc4e8..b28852051 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java @@ -25,7 +25,7 @@ public class ParticleCandyCane extends ParticleGadget public ParticleCandyCane(GadgetManager manager) { - super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, 10, Material.CHEST, (byte)0); + super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, -3, Material.CHEST, (byte)0); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index e01e24201..7b5005624 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -23,8 +23,6 @@ import mineplex.core.updater.event.UpdateEvent; public class ParticleFrostLord extends ParticleGadget { - private HashSet _arrows = new HashSet(); - public ParticleFrostLord(GadgetManager manager) { super(manager, "Wind of the Frost Lord", new String[] @@ -33,7 +31,7 @@ public class ParticleFrostLord extends ParticleGadget C.cWhite + "Your double jumps and arrows", C.cWhite + "are enchanted with snow powers.", }, - 10, + -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java index 6c510f664..639d85d23 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java @@ -26,7 +26,7 @@ public class ParticleLegend extends ParticleGadget " ", C.cGreen + "Unlocked with Legend Rank", }, - -3, + -1, Material.ENDER_PORTAL_FRAME, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index 12353e872..7d5aa7025 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -32,7 +32,7 @@ public class ParticleTitan extends ParticleGadget " ", C.cRed + "Unlocked with Titan Rank", }, - -3, + -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java index 0c5b84e98..04559e60e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java @@ -33,7 +33,7 @@ public class MountBabyReindeer extends HorseMount { C.cWhite + "One of Santa's baby reindeers", C.cWhite + "Still trying to learn how to fly" - }, Material.SNOW_BALL, (byte) 0, 10, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); + }, Material.SNOW_BALL, (byte) 0, -3, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); } @EventHandler From d6aed5dff701ea300299ba9bb8e351336968651d Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 21:32:10 -0500 Subject: [PATCH 13/51] More work --- .../core/playerCount/PlayerCountManager.java | 2 +- .../mineplex/core/treasure/gui/TreasurePage.java | 2 +- .../Mineplex.Hub/src/mineplex/hub/HubManager.java | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java b/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java index c73f87d00..826cf7636 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java @@ -64,7 +64,7 @@ public class PlayerCountManager extends MiniPlugin @EventHandler public void refresh(UpdateEvent event) { - if (event.getType() != UpdateType.SEC) + if (event.getType() != UpdateType.SLOW) return; runAsync(this::updatePlayerCount); 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 a466fb6f2..2a028405e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -112,7 +112,7 @@ public class TreasurePage extends ShopPageBase List christmasLore = new ArrayList(); christmasLore.add(" "); - christmasLore.add(F.value("Christmas Chests Owned", "" + christmasCount)); + christmasLore.add(F.value("Winter Holiday Chests Owned", "" + christmasCount)); christmasLore.add(" "); christmasLore.add(C.cGray + "All our previous adventurers have"); christmasLore.add(C.cGray + "perished in search of these chests."); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 6eaf1149a..b2b31a380 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -55,6 +55,7 @@ import mineplex.core.party.Party; import mineplex.core.party.PartyManager; import mineplex.core.personalServer.PersonalServerManager; import mineplex.core.pet.PetManager; +import mineplex.core.playerCount.PlayerCountManager; import mineplex.core.poll.PollManager; import mineplex.core.portal.Portal; import mineplex.core.preferences.PreferencesManager; @@ -157,6 +158,7 @@ public class HubManager extends MiniClientPlugin private PetManager _petManager; private PacketHandler _packetHandler; private PersonalServerManager _personalServerManager; + private PlayerCountManager _playerCountManager; // private HalloweenSpookinessManager _halloweenManager; // private TrickOrTreatManager _trickOrTreatManager; @@ -246,6 +248,8 @@ public class HubManager extends MiniClientPlugin // NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager); // new MailManager(_plugin, notificationManager); + _playerCountManager = new PlayerCountManager(plugin); + _songs = new ArrayList(); try @@ -729,14 +733,11 @@ public class HubManager extends MiniClientPlugin obj.getScore(" ").setScore(line--); //Players + int playerCount = _playerCountManager.getPlayerCount(); obj.getScore(C.cYellow + C.Bold + "Players").setScore(line--); - player.getScoreboard().resetScores(_lastPlayerCount + ""); - - _lastPlayerCount++; - - obj.getScore(_lastPlayerCount + "").setScore(line--); - + obj.getScore(playerCount + "").setScore(line--); + _lastPlayerCount = playerCount; //Space obj.getScore(" ").setScore(line--); From 1ab13d2ef5c555efae7fca99c93fe79ca4df97ba Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 10 Dec 2015 22:52:15 -0500 Subject: [PATCH 14/51] Treasure Shards! --- .../src/mineplex/core/treasure/gui/TreasurePage.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 2a028405e..889765b9b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/gui/TreasurePage.java @@ -68,7 +68,7 @@ public class TreasurePage extends ShopPageBase basicLore.add(ChatColor.RESET + C.cGreen + "Click to Open!"); else { - basicLore.add(ChatColor.RESET + "Click to Purchase for " + C.cYellow + "1000 Coins"); + basicLore.add(ChatColor.RESET + "Click to Purchase for " + C.cAqua + "1000 Treasure Shards"); basicLore.add(" "); basicLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } @@ -85,7 +85,7 @@ public class TreasurePage extends ShopPageBase heroicLore.add(ChatColor.RESET + C.cGreen + "Click to Open!"); else { - heroicLore.add(ChatColor.RESET + "Click to Purchase for " + C.cYellow + "5000 Coins"); + heroicLore.add(ChatColor.RESET + "Click to Purchase for " + C.cAqua + "5000 Treasure Shards"); heroicLore.add(" "); heroicLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } @@ -105,7 +105,7 @@ public class TreasurePage extends ShopPageBase legendaryLore.add(ChatColor.RESET + C.cGreen + "Click to Open!"); else { - legendaryLore.add(ChatColor.RESET + "Click to Purchase for " + C.cYellow + "10000 Coins"); + legendaryLore.add(ChatColor.RESET + "Click to Purchase for " + C.cAqua + "10000 Treasure Shards"); legendaryLore.add(" "); legendaryLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } @@ -125,7 +125,7 @@ public class TreasurePage extends ShopPageBase christmasLore.add(ChatColor.RESET + C.cGreen + "Click to Open!"); else { - christmasLore.add(ChatColor.RESET + "Click to Purchase for " + C.cYellow + "10000 Coins"); + christmasLore.add(ChatColor.RESET + "Click to Purchase for " + C.cAqua + "10000 Treasure Shards"); christmasLore.add(" "); christmasLore.add(ChatColor.RESET + "or Purchase at: " + C.cYellow + "www.mineplex.com/shop"); } From a5b28422cd1d0761f99b8b2b000a8e55b1968add Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 15:19:20 +1100 Subject: [PATCH 15/51] cosmetics --- .../src/mineplex/core/common/util/UtilText.java | 13 +++++++++++++ Plugins/Mineplex.Core/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +++--- .../src/mineplex/core/bonuses/BonusRepository.java | 1 - .../mineplex/core/cosmetic/ui/page/CostumePage.java | 2 -- .../gadgets/arrowtrail/ArrowTrailCandyCane.java | 8 ++++---- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java index c5a805558..a3bd9cdf9 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java @@ -288,6 +288,19 @@ public class UtilText return lines; } + + public static String[] splitLineToArray(String string, LineFormat lineFormat) + { + ArrayList lineList = splitLine(string, lineFormat); + + String[] lineArray = new String[lineList.size()]; + lineArray = lineList.toArray(lineArray); + + for (String cur : lineArray) + System.out.println(cur); + + return lineArray; + } public static ArrayList splitLine(String string, LineFormat lineFormat) { diff --git a/Plugins/Mineplex.Core/.classpath b/Plugins/Mineplex.Core/.classpath index 1b29691dd..c43f4d9b1 100644 --- a/Plugins/Mineplex.Core/.classpath +++ b/Plugins/Mineplex.Core/.classpath @@ -1,7 +1,7 @@ - + diff --git a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs index d17b6724d..a698e5967 100644 --- a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs +++ b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,12 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusRepository.java index d2b7613af..5d7440096 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusRepository.java @@ -9,7 +9,6 @@ import java.sql.Timestamp; import java.sql.Types; import java.util.Map; -import com.sun.org.apache.xpath.internal.operations.Bool; import mineplex.core.bonuses.gui.SpinGui; import mineplex.core.common.Pair; import mineplex.core.common.util.Callback; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java index 803f8705f..8e32e2707 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java @@ -9,8 +9,6 @@ import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -import com.sun.org.glassfish.gmbal.ManagedAttribute; - import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; import mineplex.core.cosmetic.CosmeticManager; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java index 85cb085d6..692fff6ff 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java @@ -8,6 +8,8 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilText.LineFormat; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.ArrowEffectGadget; @@ -17,10 +19,8 @@ public class ArrowTrailCandyCane extends ArrowEffectGadget public ArrowTrailCandyCane(GadgetManager manager) { - super(manager, "Candy Cane Arrow Effect", new String[] - { - C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".", - }, + super(manager, "Candy Cane Arrows", + UtilText.splitLineToArray(C.cWhite + "The real reason no one visits the North Pole? Santa’s Elves are deadly shots.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0); } From 88f44a293bc1215788e4b725249f8719be2f3507 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 15:31:35 +1100 Subject: [PATCH 16/51] candy! --- .../core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java index 692fff6ff..c02c7f4c5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java @@ -5,11 +5,11 @@ import org.bukkit.Material; import org.bukkit.entity.Arrow; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilText; -import mineplex.core.common.util.UtilText.LineFormat; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.ArrowEffectGadget; From 05a80b23a165365af3b434411fae4fe5142847e0 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 16:07:02 +1100 Subject: [PATCH 17/51] converting gadget text. (kill me now) --- Plugins/BuildFiles/common.xml | 10 + .../mineplex/core/common/util/UtilText.java | 13 +- .../arrowtrail/ArrowTrailFrostLord.java | 10 +- .../gadgets/arrowtrail/ArrowTrailTitan.java | 12 +- .../gadget/gadgets/death/DeathCandyCane.java | 9 +- .../gadget/gadgets/death/DeathFrostLord.java | 10 +- .../core/gadget/gadgets/death/DeathTitan.java | 12 +- .../doublejump/DoubleJumpCandyCane.java | 8 +- .../doublejump/DoubleJumpFrostLord.java | 8 +- .../gadgets/doublejump/DoubleJumpTitan.java | 12 +- .../core/gadget/gadgets/hat/HatCoal.java | 7 +- .../core/gadget/gadgets/hat/HatPresent.java | 7 +- .../core/gadget/gadgets/hat/HatSanta.java | 7 +- .../core/gadget/gadgets/hat/HatSnowman.java | 7 +- .../core/gadget/gadgets/item/ItemBatGun.java | 9 +- .../core/gadget/gadgets/item/ItemCoal.java | 11 +- .../gadget/gadgets/item/ItemCoinBomb.java | 22 +- .../gadgets/item/ItemEtherealPearl.java | 9 +- .../gadget/gadgets/item/ItemFirework.java | 10 +- .../gadget/gadgets/item/ItemFleshHook.java | 10 +- .../gadget/gadgets/item/ItemFreezeCannon.java | 11 +- .../core/gadget/gadgets/item/ItemGemBomb.java | 218 ------------------ .../gadget/gadgets/item/ItemKothSword.java | 5 - .../gadgets/item/ItemMelonLauncher.java | 10 +- .../gadget/gadgets/item/ItemPaintballGun.java | 9 +- .../gadget/gadgets/item/ItemPaintbrush.java | 10 +- .../gadget/gadgets/item/ItemPartyPopper.java | 9 +- .../gadget/gadgets/item/ItemSnowball.java | 11 +- .../core/gadget/gadgets/item/ItemTNT.java | 9 +- .../gadgets/particle/ParticleCandyCane.java | 7 +- .../gadgets/particle/ParticleCoalFumes.java | 9 +- .../gadgets/particle/ParticleFrostLord.java | 10 +- .../gadgets/particle/ParticleTitan.java | 12 +- .../src/mineplex/hub/HubManager.java | 4 +- 34 files changed, 161 insertions(+), 376 deletions(-) delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java diff --git a/Plugins/BuildFiles/common.xml b/Plugins/BuildFiles/common.xml index 4200a7c8a..4b97fdaac 100644 --- a/Plugins/BuildFiles/common.xml +++ b/Plugins/BuildFiles/common.xml @@ -9,6 +9,7 @@ + @@ -110,6 +111,7 @@ + @@ -142,6 +144,7 @@ + @@ -191,6 +194,7 @@ + @@ -239,6 +243,7 @@ + @@ -276,6 +281,7 @@ + @@ -403,6 +409,7 @@ + @@ -435,6 +442,7 @@ + @@ -462,6 +470,7 @@ + @@ -490,6 +499,7 @@ + diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java index 79a4dc61e..aec40852a 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java @@ -260,6 +260,16 @@ public class UtilText return string; } + public static String[] splitLinesToArray(String[] strings, LineFormat lineFormat) + { + ArrayList lineList = splitLines(strings, lineFormat); + + String[] lineArray = new String[lineList.size()]; + lineArray = lineList.toArray(lineArray); + + return lineArray; + } + public static ArrayList splitLines(String[] strings, LineFormat lineFormat) { ArrayList lines = new ArrayList(); @@ -279,9 +289,6 @@ public class UtilText String[] lineArray = new String[lineList.size()]; lineArray = lineList.toArray(lineArray); - for (String cur : lineArray) - System.out.println(cur); - return lineArray; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java index 020cac190..8503deb02 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java @@ -4,8 +4,10 @@ import org.bukkit.Material; import org.bukkit.entity.Arrow; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.ArrowEffectGadget; @@ -15,12 +17,8 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget { public ArrowTrailFrostLord(GadgetManager manager) { - super(manager, "Arrows of the Frost Lord", new String[] - { - C.cWhite + "You are a mighty frost lord.", - C.cWhite + "Your double jumps and arrows", - C.cWhite + "are enchanted with snow powers.", - }, + super(manager, "Arrows of the Frost Lord", + UtilText.splitLineToArray(C.cWhite + "The Frost Lord’s arrows bring a blast of winter in the wind of their passing.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java index 051684e25..773e5b677 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java @@ -7,8 +7,10 @@ import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -18,14 +20,8 @@ public class ArrowTrailTitan extends ArrowEffectGadget { public ArrowTrailTitan(GadgetManager manager) { - super(manager, "Arrows of the Titans", new String[] - { - C.cWhite + "These flames are said to be the", - C.cWhite + "souls of a lost civilisation of", - C.cWhite + "Titans, forgotten by time.", - " ", - C.cRed + "Unlocked with Titan Rank", - }, + super(manager, "Arrows of the Titans", + UtilText.splitLineToArray(C.cWhite + "Arrows forged in the Fires of Creation, they leave fiery trails in their wake.", LineFormat.LORE), -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java index 8a82b7519..748accb1a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java @@ -6,7 +6,9 @@ import org.bukkit.event.EventHandler; import mineplex.core.blood.BloodEvent; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.DeathEffectGadget; @@ -16,11 +18,8 @@ public class DeathCandyCane extends DeathEffectGadget { public DeathCandyCane(GadgetManager manager) { - super(manager, "Candy Cane Effect", new String[] - { - C.cWhite + "COLORS FTW!", - C.cWhite + "Take damage with SWAG B)", - }, + super(manager, "Candy Cane Remains", + UtilText.splitLineToArray(C.cWhite + "The biggest enemy of the Holidays, is January.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java index 2896ca7af..2f6bd3b89 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java @@ -5,6 +5,8 @@ import org.bukkit.event.EventHandler; import mineplex.core.blood.BloodEvent; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.types.DeathEffectGadget; import mineplex.core.gadget.GadgetManager; @@ -12,12 +14,8 @@ public class DeathFrostLord extends DeathEffectGadget { public DeathFrostLord(GadgetManager manager) { - super(manager, "Frost Lord Death Effect", new String[] - { - C.cWhite + "You are a mighty frost lord.", - C.cWhite + "Your double jumps and arrows", - C.cWhite + "are enchanted with snow powers.", - }, + super(manager, "Fall of the Frost Lord", + UtilText.splitLineToArray(C.cWhite + "The power of Winter must eventually give way to Spring.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java index fe8dc0982..43c8b326d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java @@ -7,6 +7,8 @@ import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.blood.BloodEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.DeathEffectGadget; @@ -14,14 +16,8 @@ public class DeathTitan extends DeathEffectGadget { public DeathTitan(GadgetManager manager) { - super(manager, "Ashes of the Titans", new String[] - { - C.cWhite + "These flames are said to be the", - C.cWhite + "souls of a lost civilisation of", - C.cWhite + "Titans, forgotten by time.", - " ", - C.cRed + "Unlocked with Titan Rank", - }, + super(manager, "Ashes of the Titans", + UtilText.splitLineToArray(C.cWhite + "Even a Titan can fall in combat if their opponent is fierce enough.", LineFormat.LORE), -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java index 8a4e17a29..b95ef4ff4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java @@ -5,9 +5,11 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.DoubleJumpEffectGadget; @@ -16,10 +18,8 @@ public class DoubleJumpCandyCane extends DoubleJumpEffectGadget public DoubleJumpCandyCane(GadgetManager manager) { - super(manager, "Candy Cane Jump Effect", new String[] - { - C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".", - }, + super(manager, "Candy Cane Blast", + UtilText.splitLineToArray(C.cWhite + "It is said every time an elf jumps, bits of Candy Cane fall out of their pockets.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java index d40c8388d..4291f9d94 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java @@ -4,7 +4,9 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; @@ -15,10 +17,8 @@ public class DoubleJumpFrostLord extends DoubleJumpEffectGadget { public DoubleJumpFrostLord(GadgetManager manager) { - super(manager, "Boots of the Frost Lord", new String[] - { - C.cWhite + "More snow incomming.", - }, + super(manager, "Gust of the Frost Lord", + UtilText.splitLineToArray(C.cWhite + "Listen, the Frost Lord is a very proper individual. Stop making fart jokes!", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java index 7749ce217..7b75adf3d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -8,8 +8,10 @@ import org.bukkit.event.player.PlayerToggleFlightEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -19,14 +21,8 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget { public DoubleJumpTitan(GadgetManager manager) { - super(manager, "Leap of the Titans", new String[] - { - C.cWhite + "These flames are said to be the", - C.cWhite + "souls of a lost civilisation of", - C.cWhite + "Titans, forgotten by time.", - " ", - C.cRed + "Unlocked with Titan Rank", - }, + super(manager, "Leap of the Titans", + UtilText.splitLineToArray(C.cWhite + "Out of the frying pan and into the fire.", LineFormat.LORE), -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java index 4bc85b096..a78b88736 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java @@ -4,6 +4,8 @@ import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.HatGadget; @@ -12,7 +14,10 @@ public class HatCoal extends HatGadget public HatCoal(GadgetManager manager) { - super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, -3, new ItemStack(Material.COAL_BLOCK)); + super(manager, "Lump of Coal", + UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + -3, + new ItemStack(Material.COAL_BLOCK)); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java index 41f74c93e..74005d330 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java @@ -1,6 +1,8 @@ package mineplex.core.gadget.gadgets.hat; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.HatGadget; @@ -9,7 +11,10 @@ public class HatPresent extends HatGadget public HatPresent(GadgetManager manager) { - super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, -3, "christmasgift"); + super(manager, "Present", + UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + -3, + "christmasgift"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java index f2fa35bbc..067f603e5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java @@ -1,6 +1,8 @@ package mineplex.core.gadget.gadgets.hat; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.HatGadget; @@ -9,7 +11,10 @@ public class HatSanta extends HatGadget public HatSanta(GadgetManager manager) { - super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, -3, "Presents"); + super(manager, "Santa", + UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + -3, + "Presents"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java index 209d78015..1e6ab44a4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java @@ -1,6 +1,8 @@ package mineplex.core.gadget.gadgets.hat; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.HatGadget; @@ -9,7 +11,10 @@ public class HatSnowman extends HatGadget public HatSnowman(GadgetManager manager) { - super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, -3, "snowman002"); + super(manager, "Snowmans Head", + UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + -3, + "snowman002"); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java index 8cfcae673..62b8b2b39 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java @@ -13,12 +13,14 @@ import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; @@ -37,11 +39,8 @@ public class ItemBatGun extends ItemGadget public ItemBatGun(GadgetManager manager) { - super(manager, "Bat Blaster", new String[] - { - C.cWhite + "Launch waves of annoying bats", - C.cWhite + "at people you don't like!", - }, + super(manager, "Bat Blaster", + UtilText.splitLineToArray(C.cWhite + "Unleash waves of terrifying bats at people you don't like!", LineFormat.LORE), -1, Material.IRON_BARDING, (byte)0, 5000, new Ammo("Bat Blaster", "50 Bats", Material.IRON_BARDING, (byte)0, new String[] { C.cWhite + "50 Bats for your Bat Blaster!" }, 500, 50)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 4d5c06203..098d136ff 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -11,6 +11,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.Callback; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilInv; @@ -19,6 +20,7 @@ import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent; import mineplex.core.gadget.gadgets.Ammo; @@ -40,12 +42,9 @@ public class ItemCoal extends ItemGadget public ItemCoal(GadgetManager manager) { - super(manager, "Coal", new String[] - { - C.cDGray + "Exclusive Coal!", - C.cDGray + "Earned by beeing naughty" - } - , 1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] + super(manager, "Coal", + UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE) + , -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] { C.cDGray + "Exclusive Coal!", C.cDGray + "Earned by beeing naughty" diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java index e68345215..d0039cd87 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoinBomb.java @@ -17,10 +17,12 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; @@ -35,27 +37,23 @@ public class ItemCoinBomb extends ItemGadget public ItemCoinBomb(GadgetManager manager) { - super(manager, "Coin Party Bomb", new String[] - { - C.cWhite + "It's party time! You will be", - C.cWhite + "everyones favourite player", - C.cWhite + "when you use one of these!", - }, + super(manager, "Treasure Party Bomb", + UtilText.splitLineToArray(C.cWhite + "It's party time! You'll be everyones favourite player when you use one of these!", LineFormat.LORE), -1, - Material.getMaterial(175), (byte)0, - 30000, new Ammo("Coin Party Bomb", "1 Coin Party Bomb", Material.getMaterial(175), (byte)0, new String[] { C.cWhite + "1 Coin Party Bomb to PARTY!" }, 2000, 1)); + Material.PRISMARINE, (byte)0, + 30000, new Ammo("Treasure Party Bomb", "1 Coin Party Bomb", Material.PRISMARINE, (byte)0, new String[] { C.cWhite + "1 Treasure Party Bomb" }, 2000, 1)); } @Override public void ActivateCustom(Player player) { - Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.GOLD_BLOCK)); + Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.PRISMARINE)); UtilAction.velocity(item, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false); _active.put(item, System.currentTimeMillis()); //Inform for (Player other : UtilServer.getPlayers()) - UtilPlayer.message(other, C.cYellow + C.Bold + player.getName() + C.cWhite + C.Bold + " has thrown a " + C.cYellow + C.Bold + "Coin Party Bomb" + C.cWhite + C.Bold + "!"); + UtilPlayer.message(other, C.cAqua + C.Bold + player.getName() + C.cWhite + C.Bold + " has thrown a " + C.cAqua + C.Bold + "Treasure Party Bomb" + C.cWhite + C.Bold + "!"); } @EventHandler @@ -74,11 +72,11 @@ public class ItemCoinBomb extends ItemGadget if (UtilTime.elapsed(time, 3000)) { if (Math.random() > 0.80) - UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BURST).trail(false).build()); + UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.AQUA).with(Type.BURST).trail(false).build()); else item.getWorld().playSound(item.getLocation(), Sound.FIREWORK_LAUNCH, 1f, 1f); - Item coin = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.getMaterial(175))); + Item coin = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.PRISMARINE_SHARD)); //Velocity long passed = System.currentTimeMillis() - time; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java index 2c07ba486..7f0b83cba 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemEtherealPearl.java @@ -19,10 +19,12 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; @@ -35,11 +37,8 @@ public class ItemEtherealPearl extends ItemGadget public ItemEtherealPearl(GadgetManager manager) { - super(manager, "Ethereal Pearl", new String[] - { - C.cWhite + "Take a ride through the skies", - C.cWhite + "on your very own Ethereal Pearl!", - }, + super(manager, "Ethereal Pearl", + UtilText.splitLineToArray(C.cWhite + "These Pearls are stolen from sleeping Endermen!", LineFormat.LORE), -1, Material.ENDER_PEARL, (byte)0, 500, new Ammo("Ethereal Pearl", "50 Pearls", Material.ENDER_PEARL, (byte)0, new String[] { C.cWhite + "50 Pearls to get around with!" }, 500, 50)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java index 1f7463054..597dc0a2a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFirework.java @@ -11,9 +11,11 @@ import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; @@ -22,12 +24,8 @@ public class ItemFirework extends ItemGadget { public ItemFirework(GadgetManager manager) { - super(manager, "Fireworks", new String[] - { - C.cWhite + "Need to celebrate?!", - C.cWhite + "Use some fireworks!", - C.cWhite + "Pew pew pew!", - }, + super(manager, "Fireworks", + UtilText.splitLineToArray(C.cWhite + "Need to celebrate? These fireworks should do the trick!", LineFormat.LORE), -1, Material.FIREWORK, (byte)0, 500, new Ammo("Fireworks", "50 Fireworks", Material.FIREWORK, (byte)0, new String[] { C.cWhite + "50 Fireworks for you to launch!" }, 500, 50)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java index e4bd3554a..a35ab819d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java @@ -11,9 +11,11 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; @@ -27,12 +29,8 @@ public class ItemFleshHook extends ItemGadget implements IThrown { public ItemFleshHook(GadgetManager manager) { - super(manager, "Flesh Hook", new String[] - { - C.cWhite + "Make new friends by throwing a hook", - C.cWhite + "into their face and pulling them", - C.cWhite + "towards you!", - }, + super(manager, "Flesh Hook", + UtilText.splitLineToArray(C.cWhite + "Make new friends by throwing a hook into their face and pulling them towards you!", LineFormat.LORE), -1, Material.getMaterial(131), (byte)0, 2000, new Ammo("Flesh Hook", "50 Flesh Hooks", Material.getMaterial(131), (byte)0, new String[] { C.cWhite + "50 Flesh Hooks for you to use!" }, 1000, 50)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java index c630f69cb..9c177ef3b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java @@ -27,10 +27,12 @@ import org.bukkit.potion.PotionEffectType; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; @@ -47,11 +49,10 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown public ItemFreezeCannon(GadgetManager manager) { - super(manager, "Freeze Cannon", new String[] - { - C.cWhite + "Freeze your nemesis inside a block of ice!" - } - , 1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[] + super(manager, "Freeze Cannon", + UtilText.splitLineToArray(C.cWhite + "Let someone cool off inside their very own ice cube!", LineFormat.LORE), + -1, + Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[] { C.cWhite + "100 Ice Blocks for you to launch!" }, -1, 1)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java deleted file mode 100644 index 0510dbf11..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemGemBomb.java +++ /dev/null @@ -1,218 +0,0 @@ -package mineplex.core.gadget.gadgets.item; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Color; -import org.bukkit.FireworkEffect; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.FireworkEffect.Type; -import org.bukkit.entity.Item; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerPickupItemEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - -import mineplex.core.common.CurrencyType; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilFirework; -import mineplex.core.common.util.UtilGear; -import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent; -import mineplex.core.gadget.gadgets.Ammo; -import mineplex.core.gadget.types.ItemGadget; -import mineplex.core.itemstack.ItemStackFactory; -import mineplex.core.recharge.Recharge; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; - -public class ItemGemBomb extends ItemGadget -{ - private HashMap _activeBombs = new HashMap(); - private HashSet _gems = new HashSet(); - - public ItemGemBomb(GadgetManager manager) - { - super(manager, "Gem Party Bomb", new String[] - { - C.cWhite + "It's party time! You will be", - C.cWhite + "everyones favourite player", - C.cWhite + "when you use one of these!", - " ", - C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "This uses 2000 Gems" - }, - -1, - Material.EMERALD, (byte)0, - 30000, new Ammo("Gem Party Bomb", "10 Gem Party Bomb", Material.EMERALD, (byte)0, new String[] { C.cWhite + "10 Coin Party Bomb to PARTY!" }, 10, 10)); - } - - @Override - @EventHandler - public void Activate(PlayerInteractEvent event) - { - if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK) - return; - - if (UtilBlock.usable(event.getClickedBlock())) - return; - - if (!UtilGear.isMat(event.getPlayer().getItemInHand(), this.GetDisplayMaterial())) - return; - - Player player = event.getPlayer(); - - if (!IsActive(player)) - return; - - event.setCancelled(true); - - //Stock - if (Manager.getInventoryManager().Get(player).getItemCount(GetName()) <= 0) - { - - UtilPlayer.message(player, F.main("Gadget", "You do not have any " + GetName() + " left.")); - - ItemGadgetOutOfAmmoEvent ammoEvent = new ItemGadgetOutOfAmmoEvent(event.getPlayer(), this); - Bukkit.getServer().getPluginManager().callEvent(ammoEvent); - - return; - } - - //Gems - if (Manager.getDonationManager().Get(player.getName()).GetBalance(CurrencyType.Gems) < 2000) - { - UtilPlayer.message(player, F.main("Inventory", "You do not have the required " + C.cGreen + "2000 Gems") + "."); - return; - } - - //Already In Use - if (!_activeBombs.isEmpty()) - { - UtilPlayer.message(player, F.main("Inventory", "There is already a " + F.elem(C.cGreen + "Gem Bomb")) + " being used."); - return; - } - - //Recharge - if (!Recharge.Instance.use(player, GetName(), _recharge, _recharge > 1000, false)) - { - UtilInv.Update(player); - return; - } - - //Use Stock/Gems - Manager.getInventoryManager().addItemToInventory(player, GetName(), -1); - Manager.getDonationManager().RewardGems(null, GetName(), event.getPlayer().getName(), event.getPlayer().getUniqueId(), -2000); - - player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(GetName()))); - - ActivateCustom(event.getPlayer()); - } - - @Override - public void ActivateCustom(Player player) - { - Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.EMERALD_BLOCK)); - UtilAction.velocity(item, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false); - _activeBombs.put(item, System.currentTimeMillis()); - - //Inform - for (Player other : UtilServer.getPlayers()) - UtilPlayer.message(other, C.cGreen + C.Bold + player.getName() + C.cWhite + C.Bold + " has thrown a " + C.cGreen + C.Bold + "Gem Party Bomb" + C.cWhite + C.Bold + "!"); - } - - @EventHandler - public void Update(UpdateEvent event) - { - if (event.getType() != UpdateType.TICK) - return; - - Iterator itemIterator = _activeBombs.keySet().iterator(); - - while (itemIterator.hasNext()) - { - Item item = itemIterator.next(); - long time = _activeBombs.get(item); - - if (UtilTime.elapsed(time, 3000)) - { - if (Math.random() > 0.80) - UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.GREEN).with(Type.BURST).trail(false).build()); - else - item.getWorld().playSound(item.getLocation(), Sound.FIREWORK_LAUNCH, 1f, 1f); - - Item gem = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.EMERALD)); - - //Velocity - long passed = System.currentTimeMillis() - time; - Vector vel = new Vector(Math.sin(passed/300d), 0, Math.cos(passed/300d)); - - UtilAction.velocity(gem, vel, Math.abs(Math.sin(passed/3000d)), false, 0, 0.2 + Math.abs(Math.cos(passed/3000d))*0.8, 1, false); - - gem.setPickupDelay(40); - - _gems.add(gem); - } - - if (UtilTime.elapsed(time, 23000)) - { - item.remove(); - itemIterator.remove(); - } - } - } - - @EventHandler - public void Pickup(PlayerPickupItemEvent event) - { - if (_activeBombs.keySet().contains(event.getItem())) - { - event.setCancelled(true); - } - else if (_gems.contains(event.getItem())) - { - event.setCancelled(true); - event.getItem().remove(); - - Manager.getDonationManager().RewardGemsLater(GetName() + " Pickup", event.getPlayer(), 4); - - event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f); - } - } - - @EventHandler - public void Clean(UpdateEvent event) - { - if (event.getType() != UpdateType.FAST) - return; - - Iterator gemIterator = _gems.iterator(); - - while (gemIterator.hasNext()) - { - Item gem = gemIterator.next(); - - if (!gem.isValid() || gem.getTicksLived() > 1200) - { - gem.remove(); - gemIterator.remove(); - } - } - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java deleted file mode 100644 index 6c694ba4c..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemKothSword.java +++ /dev/null @@ -1,5 +0,0 @@ -package mineplex.core.gadget.gadgets.item; - -public class ItemKothSword { - -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java index ebe4d779e..78269f173 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java @@ -20,10 +20,12 @@ import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; @@ -39,12 +41,8 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown public ItemMelonLauncher(GadgetManager manager) { - super(manager, "Melon Launcher", new String[] - { - C.cWhite + "Deliciously fun!", - C.cWhite + "Eat the melon slices for a", - C.cWhite + "temporary speed boost!", - }, + super(manager, "Melon Launcher", + UtilText.splitLineToArray(C.cWhite + "Because who doesn't want to shoot watermelons at people?!", LineFormat.LORE), -1, Material.MELON_BLOCK, (byte)0, 1000, new Ammo("Melon Launcher", "100 Melons", Material.MELON_BLOCK, (byte)0, new String[] { C.cWhite + "100 Melons for you to launch!" }, 500, 100)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java index ce6f5d28e..c6ad69ce8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintballGun.java @@ -21,9 +21,11 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; @@ -40,10 +42,9 @@ public class ItemPaintballGun extends ItemGadget public ItemPaintballGun(GadgetManager manager) { - super(manager, "Paintball Gun", new String[] - { - C.cWhite + "PEW PEW PEW PEW!", - }, -1, Material.GOLD_BARDING, (byte) 0, 200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING, + super(manager, "Paintball Gun", + UtilText.splitLineToArray(C.cWhite + "PEW PEW PEW!", LineFormat.LORE), + -1, Material.GOLD_BARDING, (byte) 0, 200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING, (byte) 0, new String[] { C.cWhite + "100 Paintballs for you to shoot!" diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java index a7cbba607..9fa4d783b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java @@ -18,6 +18,7 @@ import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEvent; @@ -25,6 +26,7 @@ import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; @@ -43,12 +45,8 @@ public class ItemPaintbrush extends ItemGadget public ItemPaintbrush(GadgetManager manager) { - super(manager, "Paintbrush", new String[] - { - C.cWhite + "Unleash your inner creativity!", - C.cWhite + "", - C.cGreen + "Activated at a Painter NPC", - }, + super(manager, "Paintbrush", + UtilText.splitLineToArray(C.cWhite + "Unleash your inner Bob Ross! Happy little trees!", LineFormat.LORE), -3, Material.WOOD_SWORD, (byte)0, 200, new Ammo("Paint", "100 Pixels", Material.INK_SACK, (byte)0, new String[] { C.cWhite + "100 Pixels worth of Paint!" }, 500, 100)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java index 2338a8424..460533834 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -12,8 +12,10 @@ import org.bukkit.event.EventHandler; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -31,10 +33,9 @@ public class ItemPartyPopper extends ItemGadget implements IThrown public ItemPartyPopper(GadgetManager manager) { - super(manager, "Confetti Bomb", new String[] - { - C.cWhite + "POP BANG!", - }, 1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "1 Party Popper", Material.GOLDEN_CARROT, + super(manager, "Party Popper", + UtilText.splitLineToArray(C.cWhite + "Celebrate by blasting confetti into peoples eyes!", LineFormat.LORE), + 1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Party Popper", "1 Party Popper", Material.GOLDEN_CARROT, (byte) 0, new String[] { C.cWhite + "100 Party Poppers for you to shoot!" diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java index 8c5a232d3..f1a52b32c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java @@ -11,7 +11,9 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.gadget.gadgets.Ammo; @@ -24,12 +26,9 @@ public class ItemSnowball extends ItemGadget public ItemSnowball(GadgetManager manager) { - super(manager, "Snowball", new String[] - { - C.cWhite + "Throw snowball!", - C.cWhite + "Start epic snowfights!" - } - , 1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "1 Snowball", Material.SNOW_BALL, (byte) 0, new String[] + super(manager, "Snowball", + UtilText.splitLineToArray(C.cWhite + "Join in on the festive fun by throwing snow at people!", LineFormat.LORE), + -1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "1 Snowball", Material.SNOW_BALL, (byte) 0, new String[] { C.cWhite + "50 Snowballs for you to throw!" } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java index 0bf4a04d3..e3b5f01f9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemTNT.java @@ -12,11 +12,13 @@ import org.bukkit.event.entity.EntityExplodeEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -31,11 +33,8 @@ public class ItemTNT extends ItemGadget public ItemTNT(GadgetManager manager) { - super(manager, "TNT", new String[] - { - C.cWhite + "Blow some people up!", - C.cWhite + "KABOOM!", - }, + super(manager, "TNT", + UtilText.splitLineToArray(C.cWhite + "Throwing TNT at Mineplex Staff is highly encouraged.", LineFormat.LORE), -1, Material.TNT, (byte)0, 1000, new Ammo("TNT", "20 TNT", Material.TNT, (byte)0, new String[] { C.cWhite + "20 TNT for you to explode!" }, 500, 20)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java index b28852051..557bdfd95 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java @@ -10,7 +10,10 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.util.Vector; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -25,7 +28,9 @@ public class ParticleCandyCane extends ParticleGadget public ParticleCandyCane(GadgetManager manager) { - super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, -3, Material.CHEST, (byte)0); + super(manager, "Crushed Candy Cane", + UtilText.splitLineToArray(C.cWhite + "There’s no such thing as too much Christmas Candy. Don’t listen to your dentist.", LineFormat.LORE), + -3, Material.CHEST, (byte)0); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java index 04ccec81d..03f93f17d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java @@ -5,7 +5,9 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -18,10 +20,9 @@ public class ParticleCoalFumes extends ParticleGadget public ParticleCoalFumes(GadgetManager manager) { - super(manager, "Coal Fumes", new String[] - { - C.cDGray + "Nothing to read here. Please move on." - }, -1, Material.COAL, (byte) 0); + super(manager, "Coal Fumes", + UtilText.splitLineToArray(C.cWhite + "Being on the Naughty List does have some perks... if you love coal, that is...", LineFormat.LORE), + -1, Material.COAL, (byte) 0); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index 7b5005624..3155b40af 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -9,7 +9,9 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; @@ -25,12 +27,8 @@ public class ParticleFrostLord extends ParticleGadget { public ParticleFrostLord(GadgetManager manager) { - super(manager, "Wind of the Frost Lord", new String[] - { - C.cWhite + "You are a mighty frost lord.", - C.cWhite + "Your double jumps and arrows", - C.cWhite + "are enchanted with snow powers.", - }, + super(manager, "Wind of the Frost Lord", + UtilText.splitLineToArray(C.cWhite + "He’s not passing wind okay? HE HAS A CONDITION!", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index 7d5aa7025..9fffc21fd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -9,7 +9,9 @@ import org.bukkit.util.Vector; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; @@ -24,14 +26,8 @@ public class ParticleTitan extends ParticleGadget public ParticleTitan(GadgetManager manager) { - super(manager, "Flame of the Titans", new String[] - { - C.cWhite + "These flames are said to be the", - C.cWhite + "souls of a lost civilisation of", - C.cWhite + "Titans, forgotten by time.", - " ", - C.cRed + "Unlocked with Titan Rank", - }, + super(manager, "Flame of the Titans", + UtilText.splitLineToArray(C.cWhite + "Only the legendary warriors known as Titans can survive the fiery pits of Hades.", LineFormat.LORE), -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index b2b31a380..3583b5df5 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -453,8 +453,8 @@ public class HubManager extends MiniClientPlugin String playerName = player.getName(); // April Fools - if (AprilFoolsManager.Instance.isActive()) - playerName = AprilFoolsManager.Instance.getName(player); +// if (AprilFoolsManager.Instance.isActive()) +// playerName = AprilFoolsManager.Instance.getName(player); //Public Message event.setJoinMessage(null); From fe7ce40783acff4d3b960be7c235c2d0c7df4716 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 16:31:15 +1100 Subject: [PATCH 18/51] finished cosmetic names --- .../core/cosmetic/ui/page/GadgetPage.java | 43 ++++++++--- .../core/gadget/gadgets/morph/MorphBat.java | 18 +++-- .../core/gadget/gadgets/morph/MorphBlaze.java | 13 ++-- .../core/gadget/gadgets/morph/MorphBlock.java | 6 +- .../core/gadget/gadgets/morph/MorphBunny.java | 10 +-- .../gadget/gadgets/morph/MorphChicken.java | 6 +- .../core/gadget/gadgets/morph/MorphCow.java | 6 +- .../gadget/gadgets/morph/MorphCreeper.java | 12 +-- .../gadget/gadgets/morph/MorphEnderman.java | 8 +- .../core/gadget/gadgets/morph/MorphGeno.java | 75 ------------------- .../core/gadget/gadgets/morph/MorphNotch.java | 70 ----------------- .../core/gadget/gadgets/morph/MorphPig.java | 10 +-- .../gadgets/morph/MorphPumpkinKing.java | 14 ++-- .../core/gadget/gadgets/morph/MorphSlime.java | 8 +- .../gadget/gadgets/morph/MorphSnowman.java | 15 +++- .../core/gadget/gadgets/morph/MorphTitan.java | 16 ++-- .../gadget/gadgets/morph/MorphVillager.java | 6 +- .../gadget/gadgets/morph/MorphWither.java | 12 +-- .../gadgets/particle/ParticleEnchant.java | 11 +-- .../gadgets/particle/ParticleFireRings.java | 10 +-- .../gadget/gadgets/particle/ParticleFoot.java | 11 +-- .../gadgets/particle/ParticleGreen.java | 10 +-- .../gadgets/particle/ParticleHeart.java | 10 +-- .../gadgets/particle/ParticleHelix.java | 10 +-- .../gadgets/particle/ParticleLegend.java | 11 +-- .../gadget/gadgets/particle/ParticleRain.java | 10 +-- 26 files changed, 157 insertions(+), 274 deletions(-) delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index d94654926..7370cb2ce 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -22,7 +22,6 @@ import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton; import mineplex.core.cosmetic.ui.button.GadgetButton; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.gadgets.morph.MorphBlock; -import mineplex.core.gadget.gadgets.morph.MorphNotch; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; @@ -71,14 +70,8 @@ public class GadgetPage extends ShopPageBase protected void addGadget(Gadget gadget, int slot) { - if (gadget instanceof MorphNotch) - { - //setItem(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Disabled " + gadget.GetName(), new String[] { "Sorry! Currently disabled until fix is made for 1.8 players!" }, 1, false, false)); - //return; - } - else if (gadget instanceof MorphBlock) + if (gadget instanceof MorphBlock) { - //Prevent stacker bug if (getPlayer().getPassenger() != null) return; } @@ -98,6 +91,7 @@ public class GadgetPage extends ShopPageBase { //Nothing } + //Chest Unlocks else if (gadget.GetCost(CurrencyType.Coins) == -2) { itemLore.add(C.cBlack); @@ -106,7 +100,38 @@ public class GadgetPage extends ShopPageBase else if (gadget.GetCost(CurrencyType.Coins) == -3) { itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Found in Winter Holiday Treasure Chests"); + itemLore.add(C.cWhite + "Found in Winter Holiday Treasure"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhite + "Found in Halloween Pumpkin Treasure"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhite + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (gadget.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); } if (gadget instanceof ItemGadget) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java index 77e253f93..039027011 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java @@ -19,12 +19,14 @@ import org.bukkit.potion.PotionEffectType; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.disguise.disguises.DisguiseBat; import mineplex.core.projectile.IThrown; @@ -40,15 +42,15 @@ public class MorphBat extends MorphGadget implements IThrown { public MorphBat(GadgetManager manager) { - super(manager, "Bat Morph", new String[] + super(manager, "Bat Morph", + UtilText.splitLinesToArray(new String[] { - C.cWhite + "Flap around and annoy people by", - C.cWhite + "screeching loudly into their ears!", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Screech", - C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", - C.cYellow + "Tap Sneak" + C.cGray + " to use " + C.cGreen + "Poop", - }, + C.cWhite + "Flap around and annoy people by screeching loudly into their ears!", + " ", + C.cYellow + "Left-Click" + C.cGray + " to " + C.cGreen + "Screech", + C.cYellow + "Double Jump" + C.cGray + " to " + C.cGreen + "Flap", + C.cYellow + "Sneak" + C.cGray + " to " + C.cGreen + "Poop", + }, LineFormat.LORE), 40000, Material.SKULL_ITEM, (byte)1); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java index 67afa8bcb..2514a515f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java @@ -9,9 +9,11 @@ import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.disguise.disguises.DisguiseBlaze; @@ -24,15 +26,14 @@ public class MorphBlaze extends MorphGadget { public MorphBlaze(GadgetManager manager) { - super(manager, "Blaze Morph", new String[] + super(manager, "Blaze Morph", + UtilText.splitLinesToArray(new String[] { - C.cWhite + "Transforms the wearer into a fiery Blaze!", + C.cWhite + "Transform into a fiery Blaze, straight from the Nether!", " ", C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Firefly", - " ", - C.cPurple + "Unlocked with Hero Rank", - }, - -1, + }, LineFormat.LORE), + -11, Material.BLAZE_POWDER, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java index 208618c10..210e8aae5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java @@ -14,9 +14,11 @@ import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.player.PlayerInteractEvent; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.event.StackerEvent; import mineplex.core.gadget.GadgetManager; @@ -32,13 +34,13 @@ public class MorphBlock extends MorphGadget public MorphBlock(GadgetManager manager) { - super(manager, "Block Morph", new String[] + super(manager, "Block Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "The blockiest block that ever blocked.", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Change Block", C.cYellow + "Stay Still" + C.cGray + " to use " + C.cGreen + "Solidify", - }, + }, LineFormat.LORE), 30000, Material.EMERALD_BLOCK, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java index 056f1e33a..31e971ecc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java @@ -24,12 +24,14 @@ import org.bukkit.potion.PotionEffectType; import mineplex.core.common.CurrencyType; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; @@ -50,7 +52,7 @@ public class MorphBunny extends MorphGadget public MorphBunny(GadgetManager manager) { - super(manager, "Easter Bunny Morph", new String[] + super(manager, "Easter Bunny Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Happy Easter!", " ", @@ -58,10 +60,8 @@ public class MorphBunny extends MorphGadget C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg", " ", C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , - " ", - C.cPurple + "No longer available", - }, - -1, + }, LineFormat.LORE), + -5, Material.MONSTER_EGG, (byte)98); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java index dcf03e51c..2f782c036 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java @@ -17,10 +17,12 @@ import org.bukkit.util.Vector; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.disguise.disguises.DisguiseChicken; import mineplex.core.recharge.Recharge; @@ -33,13 +35,13 @@ public class MorphChicken extends MorphGadget { public MorphChicken(GadgetManager manager) { - super(manager, "Chicken Morph", new String[] + super(manager, "Chicken Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Soar through the air like a fat Chicken!", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Egg Shot", C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", - }, + }, LineFormat.LORE), 20000, Material.FEATHER, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java index f16a35bce..70b56b04f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java @@ -7,7 +7,9 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.player.*; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.disguise.disguises.DisguiseCow; import mineplex.core.recharge.Recharge; @@ -18,12 +20,12 @@ public class MorphCow extends MorphGadget { public MorphCow(GadgetManager manager) { - super(manager, "Cow Morph", new String[] + super(manager, "Cow Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "How now brown cow?", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Moo", - }, + }, LineFormat.LORE), 6000, Material.LEATHER, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java index d2d5b0954..d6f4cd78f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java @@ -13,11 +13,13 @@ import org.bukkit.event.player.PlayerQuitEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.disguise.disguises.DisguiseBase; @@ -33,15 +35,13 @@ public class MorphCreeper extends MorphGadget public MorphCreeper(GadgetManager manager) { - super(manager, "Creeper Morph", new String[] + super(manager, "Creeper Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Transforms the wearer into a creepy Creeper!", + C.cWhite + "Become the creepiest of Creepers that ever creeped!", " ", C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate", - " ", - C.cPurple + "Unlocked with Hero Rank", - }, - -1, + }, LineFormat.LORE), + -11, Material.SKULL_ITEM, (byte)4); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java index e6341e98b..f5305b19f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java @@ -16,8 +16,10 @@ import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilText; import mineplex.core.disguise.disguises.DisguiseEnderman; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.MorphGadget; @@ -29,12 +31,12 @@ public class MorphEnderman extends MorphGadget { public MorphEnderman(GadgetManager manager) { - super(manager, "Enderman Morph", new String[] + super(manager, "Enderman Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Transforms the wearer into an Enderman!", + C.cWhite + "Using morph is the ultimate diet! Guaranteed instant results!", " ", C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Blink", - }, + }, LineFormat.LORE), 30000, Material.ENDER_PEARL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java deleted file mode 100644 index 0eb48894d..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphGeno.java +++ /dev/null @@ -1,75 +0,0 @@ -package mineplex.core.gadget.gadgets.morph; - -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.player.*; - -import com.mojang.authlib.GameProfile; - -import mineplex.core.common.util.C; -import mineplex.core.common.util.ProfileLoader; -import mineplex.core.common.util.UUIDFetcher; -import mineplex.core.common.util.UtilEvent; -import mineplex.core.common.util.UtilEvent.ActionType; -import mineplex.core.disguise.disguises.DisguisePlayer; -import mineplex.core.recharge.Recharge; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.types.MorphGadget; - -public class MorphGeno extends MorphGadget -{ - private GameProfile _profile = null; - - public MorphGeno(GadgetManager manager) - { - super(manager, "Genocide604", new String[] - { - "Say goodbye to Genocide604 by burping", - "and eating a lot.", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Burp", - " ", - C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "This is a temporary item!", - }, - 10, - Material.SKULL_ITEM, (byte)3); - - _profile = new ProfileLoader(UUIDFetcher.getUUIDOf("Genocide604").toString(), "Genocide604").loadProfile(); - } - - @Override - public void EnableCustom(final Player player) - { - this.ApplyArmor(player); - - DisguisePlayer disguise = new DisguisePlayer(player, _profile); - Manager.getDisguiseManager().disguise(disguise); - } - - @Override - public void DisableCustom(Player player) - { - this.RemoveArmor(player); - Manager.getDisguiseManager().undisguise(player); - } - - @EventHandler - public void Action(PlayerInteractEvent event) - { - Player player = event.getPlayer(); - - if (!IsActive(player)) - return; - - if (!UtilEvent.isAction(event, ActionType.L)) - return; - - if (!Recharge.Instance.use(player, GetName(), 1500, false, false)) - return; - - player.getWorld().playSound(player.getEyeLocation(), Sound.BURP, 1f, (float) (0.8f + Math.random() * 0.4f)); - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java deleted file mode 100644 index 7671cd11c..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphNotch.java +++ /dev/null @@ -1,70 +0,0 @@ -package mineplex.core.gadget.gadgets.morph; - -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.player.*; - -import com.mojang.authlib.GameProfile; - -import mineplex.core.common.util.C; -import mineplex.core.common.util.ProfileLoader; -import mineplex.core.common.util.UUIDFetcher; -import mineplex.core.common.util.UtilEvent; -import mineplex.core.common.util.UtilEvent.ActionType; -import mineplex.core.disguise.disguises.DisguisePlayer; -import mineplex.core.recharge.Recharge; -import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.types.MorphGadget; - -public class MorphNotch extends MorphGadget -{ - private GameProfile _notchProfile = null; - - public MorphNotch(GadgetManager manager) - { - super(manager, "Notch", new String[] - { - "Who wouldn't want to be Notch?!", - //C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Enforce EULA", - }, - 50000, - Material.SKULL_ITEM, (byte)3); - - _notchProfile = new ProfileLoader(UUIDFetcher.getUUIDOf("Notch").toString(), "Notch").loadProfile(); - } - - @Override - public void EnableCustom(final Player player) - { - this.ApplyArmor(player); - - DisguisePlayer disguise = new DisguisePlayer(player, _notchProfile); - Manager.getDisguiseManager().disguise(disguise); - } - - @Override - public void DisableCustom(Player player) - { - this.RemoveArmor(player); - Manager.getDisguiseManager().undisguise(player); - } - - //@EventHandler - public void Action(PlayerInteractEvent event) - { - Player player = event.getPlayer(); - - if (!IsActive(player)) - return; - - if (!UtilEvent.isAction(event, ActionType.L)) - return; - - if (!Recharge.Instance.use(player, GetName(), 1500, false, false)) - return; - - player.sendMessage("You have enforced the EULA."); - - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java index 5a44e8322..65475ef7b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java @@ -11,11 +11,13 @@ import org.bukkit.event.player.*; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.disguises.DisguisePig; @@ -31,16 +33,14 @@ public class MorphPig extends MorphGadget public MorphPig(GadgetManager manager) { - super(manager, "Pig Morph", new String[] + super(manager, "Pig Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Oink. Oink. Oink.... Oink?", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink", C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce", - " ", - C.cAqua + "Unlocked with Ultra Rank", - }, - -1, + }, LineFormat.LORE), + -10, Material.PORK, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java index 1e155f20c..cf0016bbb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java @@ -7,7 +7,9 @@ import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.disguise.disguises.DisguiseSkeleton; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.MorphGadget; @@ -17,15 +19,11 @@ public class MorphPumpkinKing extends MorphGadget { public MorphPumpkinKing(GadgetManager manager) { - super(manager, "Pumpkin Kings Head", new String[] + super(manager, "Pumpkin Kings Head", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Transforms the wearer into", - C.cWhite + "the dreaded Pumpkin King!", - "", - C.cYellow + "Earned by defeating the Pumpkin King", - C.cYellow + "in the 2013 Halloween Horror Event.", - }, - -1, + C.cWhite + "Transforms the wearer into the dreaded Pumpkin King!", + }, LineFormat.LORE), + -4, Material.PUMPKIN, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java index 6813bbcb3..6f0f8f89f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java @@ -9,9 +9,11 @@ import org.bukkit.event.player.*; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.disguise.disguises.DisguiseSlime; import mineplex.core.recharge.Recharge; @@ -25,14 +27,14 @@ public class MorphSlime extends MorphGadget public MorphSlime(GadgetManager manager, AchievementManager achievements) { - super(manager, "Big Larry Morph", new String[] + super(manager, "Big Larry Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Become a slime like Big Larry!", + C.cWhite + "Have you ever looked at Big Larry and thought, \'I really want to be that guy!\'? Well, today is your lucky day!", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Bounce", " ", C.cWhite + "+1 Slime Size for every 10 Mineplex Levels", - }, + }, LineFormat.LORE), 80000, Material.SLIME_BALL, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java index 4451b7b72..e9a4ee54c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java @@ -14,10 +14,12 @@ import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; @@ -39,9 +41,16 @@ public class MorphSnowman extends MorphGadget public MorphSnowman(GadgetManager manager) { - super(manager, "Snowman Morph", - new String[]{ C.cWhite + "Do you wanna build a snowman?", C.cWhite + "It doesn't have to be a snowman...", - C.cWhite + "Or... it kind of does...", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Snowball", }, + super(manager, "Olaf Morph", + UtilText.splitLinesToArray(new String[] + { + C.cWhite + "Do you wanna build a snowman?", + C.cWhite + "It doesn't have to be a snowman...", + C.cWhite + "Or... it kind of does...", + " ", + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Blizzard", + C.cYellow + "Sneak" + C.cGray + " to use " + C.cGreen + "Snow Slide", + }, LineFormat.LORE), -3, Material.SNOW_BALL, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java index 213332edf..91ba7a3f8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java @@ -17,11 +17,13 @@ import org.bukkit.util.Vector; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; @@ -42,15 +44,13 @@ public class MorphTitan extends MorphGadget public MorphTitan(GadgetManager manager) { - super(manager, "Elder Guardian Morph", new String[] + super(manager, "Elder Guardian Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "From the depths of the sea, the", - C.cWhite + "Elder Guardian posseses powers", - C.cWhite + "more amazing than any seen before!", - " ", - C.cRed + "Unlocked with Titan Rank", - }, - -1, + C.cWhite + "From the depths of the sea, the Elder Guardian posseses powers more amazing than any seen before!", + " ", + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Guardians Laser", + }, LineFormat.LORE), + -13, Material.PRISMARINE_CRYSTALS, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java index def1ee383..3c537f731 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java @@ -19,10 +19,12 @@ import org.bukkit.util.Vector; import mineplex.core.common.CurrencyType; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.disguise.disguises.DisguiseVillager; @@ -40,14 +42,14 @@ public class MorphVillager extends MorphGadget implements IThrown public MorphVillager(GadgetManager manager) { - super(manager, "Villager Morph", new String[] + super(manager, "Villager Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "HURRRR! MURR HURRR!", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Gem Throw", " ", C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Gem Throw uses 20 Gems" - }, + }, LineFormat.LORE), 12000, Material.EMERALD, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java index 1d2bde3bb..0bf2c6695 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java @@ -6,10 +6,12 @@ import java.util.Iterator; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; @@ -43,15 +45,13 @@ public class MorphWither extends MorphGadget public MorphWither(GadgetManager manager) { - super(manager, "Wither Morph", new String[] + super(manager, "Wither Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Become a legendary Wither!", + C.cWhite + "Legends have foretold the coming of a powerful Wither...", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull", - " ", - C.cGreen + "Unlocked with Legend Rank", - }, - -1, + }, LineFormat.LORE), + -12, Material.SKULL_ITEM, (byte)1); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java index 38a505914..a388a0d3d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java @@ -6,8 +6,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.ParticleGadget; @@ -19,13 +21,8 @@ public class ParticleEnchant extends ParticleGadget { public ParticleEnchant(GadgetManager manager) { - super(manager, "Enchanted", new String[] - { - C.cWhite + "The wisdom of the universe", - C.cWhite + "suddenly finds you extremely", - C.cWhite + "attractive, and wants to", - C.cWhite + "\'enchant\' you.", - }, + super(manager, "Enchanted", + UtilText.splitLineToArray(C.cWhite + "The wisdom of the universe suddenly find you extremely attractive, and wants to \'enchant\' you.", LineFormat.LORE), -2, Material.BOOK, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java index ba639675a..0de43a6da 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java @@ -7,8 +7,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.ParticleGadget; @@ -21,12 +23,8 @@ public class ParticleFireRings extends ParticleGadget public ParticleFireRings(GadgetManager manager) { - super(manager, "Flame Rings", new String[] - { - C.cWhite + "Forged from the burning ashes", - C.cWhite + "of 1000 Blazes by the infamous", - C.cWhite + "Flame King of the Nether realm.", - }, + super(manager, "Flame Rings", + UtilText.splitLineToArray(C.cWhite + "Forged from the blazing rods of 1000 Blazes by the infamous Nether King.", LineFormat.LORE), -2, Material.BLAZE_POWDER, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java index e156de492..af9fd1155 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java @@ -14,11 +14,13 @@ import org.bukkit.event.EventHandler; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; @@ -35,13 +37,8 @@ public class ParticleFoot extends ParticleGadget public ParticleFoot(GadgetManager manager) { - super(manager, "Shadow Walk", new String[] - { - C.cWhite + "In a world where footprints", - C.cWhite + "do not exist, leaving your", - C.cWhite + "shadow behind is the next", - C.cWhite + "best thing.", - }, + super(manager, "Shadow Walk", + UtilText.splitLineToArray(C.cWhite + "In a world where footprints do not exist, leaving your shadow behind is the next best thing!", LineFormat.LORE), -2, Material.LEATHER_BOOTS, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java index 920de097b..1a524c676 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java @@ -7,8 +7,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.ParticleGadget; @@ -21,12 +23,8 @@ public class ParticleGreen extends ParticleGadget public ParticleGreen(GadgetManager manager) { - super(manager, "Green Ring", new String[] - { - C.cWhite + "With these sparkles, you", - C.cWhite + "can now sparkle while you", - C.cWhite + "sparkle with CaptainSparklez.", - }, + super(manager, "Green Ring", + UtilText.splitLineToArray(C.cWhite + "With these sparkles, you can sparkle while sparkle with CaptainSparklez!", LineFormat.LORE), -2, Material.EMERALD, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java index d4160c997..64ddaf216 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java @@ -13,11 +13,13 @@ import org.bukkit.event.player.PlayerQuitEvent; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.ParticleGadget; @@ -31,12 +33,8 @@ public class ParticleHeart extends ParticleGadget { public ParticleHeart(GadgetManager manager) { - super(manager, "I Heart You", new String[] - { - C.cWhite + "With these particles, you can", - C.cWhite + "show off how much you heart", - C.cWhite + "everyone on Mineplex!", - }, + super(manager, "I Heart You", + UtilText.splitLineToArray(C.cWhite + "Show off how much you love Mineplex and everyone on it!", LineFormat.LORE), -2, Material.APPLE, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java index 26e47dae7..7ccaed9c4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java @@ -7,7 +7,9 @@ import org.bukkit.event.EventHandler; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; @@ -21,12 +23,8 @@ public class ParticleHelix extends ParticleGadget public ParticleHelix(GadgetManager manager) { - super(manager, "Blood Helix", new String[] - { - C.cWhite + "Ancient legend says this magic", - C.cWhite + "empowers the blood of its user,", - C.cWhite + "giving them godly powers.", - }, + super(manager, "Blood Helix", + UtilText.splitLineToArray(C.cWhite + "Blood magic is very dangerous... but also very cool!", LineFormat.LORE), -2, Material.REDSTONE, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java index 639d85d23..329e15b6b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java @@ -8,6 +8,8 @@ import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.types.ParticleGadget; import mineplex.core.inventory.ClientItem; import mineplex.core.inventory.data.Item; @@ -19,13 +21,8 @@ public class ParticleLegend extends ParticleGadget { public ParticleLegend(GadgetManager manager) { - super(manager, "Legendary Aura", new String[] - { - C.cWhite + "These mystic particle attach to", - C.cWhite + "only the most legendary of players!", - " ", - C.cGreen + "Unlocked with Legend Rank", - }, + super(manager, "Legendary Aura", + UtilText.splitLineToArray(C.cWhite + "This particle will be updated soon! Yay!", LineFormat.LORE), -1, Material.ENDER_PORTAL_FRAME, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java index 8d6755b3c..068cd7db7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java @@ -7,8 +7,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.types.ParticleGadget; @@ -21,12 +23,8 @@ public class ParticleRain extends ParticleGadget public ParticleRain(GadgetManager manager) { - super(manager, "Rain Cloud", new String[] - { - C.cWhite + "Your very own rain cloud!", - C.cWhite + "Now you never have to worry", - C.cWhite + "about not being wet. Woo...", - }, + super(manager, "Rain Cloud", + UtilText.splitLineToArray(C.cWhite + "Bring your sadness wherever you go, with your very own portable rain cloud!", LineFormat.LORE), -2, Material.INK_SACK, (byte)4); } From 7f8c9c02bc34bdee9ae5b5a4ca6d6e84595c2803 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 16:38:44 +1100 Subject: [PATCH 19/51] and the mounts --- .../gadget/gadgets/particle/ParticleTitan.java | 2 +- .../core/mount/types/MountBabyReindeer.java | 10 +++++----- .../src/mineplex/core/mount/types/MountCart.java | 10 +++++----- .../mineplex/core/mount/types/MountDragon.java | 14 +++++--------- .../src/mineplex/core/mount/types/MountFrost.java | 10 ++++------ .../src/mineplex/core/mount/types/MountMule.java | 9 +++++---- .../src/mineplex/core/mount/types/MountSheep.java | 9 +++++---- .../src/mineplex/core/mount/types/MountSlime.java | 10 +++++----- .../mineplex/core/mount/types/MountSpider.java | 14 +++++++------- .../src/mineplex/core/mount/types/MountTitan.java | 13 +++++-------- .../mineplex/core/mount/types/MountUndead.java | 10 ++++------ .../mineplex/core/mount/types/MountZombie.java | 15 +++++---------- 12 files changed, 56 insertions(+), 70 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index 9fffc21fd..49724dfbe 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -27,7 +27,7 @@ public class ParticleTitan extends ParticleGadget public ParticleTitan(GadgetManager manager) { super(manager, "Flame of the Titans", - UtilText.splitLineToArray(C.cWhite + "Only the legendary warriors known as Titans can survive the fiery pits of Hades.", LineFormat.LORE), + UtilText.splitLineToArray(C.cWhite + "These flames are said to be the spirit of a Titan.", LineFormat.LORE), -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java index 04559e60e..f5e7eef9b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java @@ -13,8 +13,10 @@ import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.mount.HorseMount; @@ -29,11 +31,9 @@ public class MountBabyReindeer extends HorseMount public MountBabyReindeer(MountManager manager) { - super(manager, "Baby Rainder", new String[] - { - C.cWhite + "One of Santa's baby reindeers", - C.cWhite + "Still trying to learn how to fly" - }, Material.SNOW_BALL, (byte) 0, -3, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); + super(manager, "Baby Rainder", + UtilText.splitLineToArray(C.cWhite + "One of Santas baby reindeers. He's still learning how to fly...", LineFormat.LORE), + Material.SNOW_BALL, (byte) 0, -3, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java index f5aa7f809..144289439 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java @@ -11,12 +11,15 @@ import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.mount.Mount; import mineplex.core.mount.MountManager; import mineplex.core.mount.SingleEntityMountData; @@ -28,11 +31,8 @@ public class MountCart extends Mount> { public MountCart(MountManager manager) { - super(manager, "Minecart", Material.MINECART, (byte)0, new String[] - { - ChatColor.RESET + "Cruise around town in your", - ChatColor.RESET + "new Minecart VX Turbo!", - }, + super(manager, "Minecart", Material.MINECART, (byte)0, + UtilText.splitLineToArray(C.cWhite + "Cruise around town in your shiny new Minecart RX Turbo!", LineFormat.LORE), 15000); KnownPackage = false; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java index efb19dcf5..0bdddc6be 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java @@ -10,7 +10,9 @@ import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; @@ -24,17 +26,11 @@ public class MountDragon extends DragonMount { public MountDragon(MountManager manager) { - super(manager, "Ethereal Dragon", new String[] - { - C.cWhite + "From the distant ether realm,", - C.cWhite + "this prized dragon is said to", - C.cWhite + "obey only true Heroes!", - " ", - C.cPurple + "Unlocked with Hero Rank", - }, + super(manager, "Ethereal Dragon", + UtilText.splitLineToArray(C.cWhite + "From the distant Ether Realm, this prized dragon is said to only obey true Heroes!", LineFormat.LORE), Material.DRAGON_EGG, (byte)0, - -1); + -11); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java index e948ca9e3..6b978f050 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java @@ -8,7 +8,9 @@ import org.bukkit.entity.Horse.Variant; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.mount.HorseMount; @@ -21,12 +23,8 @@ public class MountFrost extends HorseMount { public MountFrost(MountManager manager) { - super(manager, "Glacial Steed", new String[] - { - C.cWhite + "Born in the North Pole,", - C.cWhite + "it leaves a trail of frost", - C.cWhite + "as it moves!", - }, + super(manager, "Glacial Steed", + UtilText.splitLineToArray(C.cWhite + "Born in the North Pole, it leaves a trail of frost as it moves!", LineFormat.LORE), Material.SNOW_BALL, (byte)0, 15000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java index be87f0fd1..d8536e772 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java @@ -6,6 +6,9 @@ import org.bukkit.entity.Horse.Color; import org.bukkit.entity.Horse.Style; import org.bukkit.entity.Horse.Variant; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.mount.HorseMount; import mineplex.core.mount.MountManager; @@ -13,10 +16,8 @@ public class MountMule extends HorseMount { public MountMule(MountManager manager) { - super(manager, "Mount Mule", new String[] - { - ChatColor.RESET + "Muley muley!" - }, + super(manager, "Mount Mule", + UtilText.splitLineToArray(C.cWhite + "Your very own trusty pack mule!", LineFormat.LORE), Material.HAY_BLOCK, (byte)0, 3000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java index c2697c771..f3b84ce99 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java @@ -11,8 +11,11 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseSheep; import mineplex.core.mount.HorseMount; @@ -25,10 +28,8 @@ public class MountSheep extends HorseMount { public MountSheep(MountManager manager) { - super(manager, "Techno Sheep", new String[] - { - ChatColor.RESET + "Muley muley!" - }, + super(manager, "Techno Sheep", + UtilText.splitLineToArray(C.cWhite + "Baaaaa with all the colors of the rainbow!", LineFormat.LORE), Material.WOOL, (byte)14, 3000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java index e8a1bd649..37b418d1a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java @@ -11,12 +11,15 @@ import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.util.Vector; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.mount.Mount; import mineplex.core.mount.MountManager; import mineplex.core.mount.SingleEntityMountData; @@ -28,11 +31,8 @@ public class MountSlime extends Mount> { public MountSlime(MountManager manager) { - super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, new String[] - { - ChatColor.RESET + "Bounce around on your very", - ChatColor.RESET + "own personal slime friend!", - }, + super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, + UtilText.splitLineToArray(C.cWhite + "Bounce around on your very own slime friend!", LineFormat.LORE), 15000); KnownPackage = false; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java index 57ca4045b..0e4058aa4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java @@ -19,11 +19,13 @@ import org.bukkit.util.Vector; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.disguise.disguises.DisguiseSpider; import mineplex.core.mount.HorseMount; import mineplex.core.mount.MountManager; @@ -41,17 +43,15 @@ public class MountSpider extends HorseMount public MountSpider(MountManager manager) { - super(manager, "Spider Mount", new String[] + super(manager, "Spider Mount", + UtilText.splitLinesToArray(new String[] { - C.cWhite + "Why ride a horse when you can", - C.cWhite + "ride a cute and cuddly spider!", + C.cWhite + "Why ride a horse when you can ride a cute and cuddly spider!", C.cBlack, C.cYellow + "Look Up" + C.cGray + " to use " + C.cGreen + "Wall Climb", C.cYellow + "Jump" + C.cGray + " to use " + C.cGreen + "Leap", - C.cBlack, - C.cPurple + "Only available during " + C.Line + "Halloween 2015", - C.cPurple + "Purchase at " + C.Line + "www.mineplex.com/shop" - }, Material.WEB, (byte) 0, -1, Color.BLACK, Style.NONE, Variant.HORSE, 2.0, Material.AIR); + }, LineFormat.LORE), + Material.WEB, (byte) 0, -4, Color.BLACK, Style.NONE, Variant.HORSE, 2.0, Material.AIR); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java index 49bd13513..89927e4d1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java @@ -13,7 +13,9 @@ import org.bukkit.event.player.PlayerJoinEvent; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilText; import mineplex.core.mount.Mount; import mineplex.core.mount.MountManager; import mineplex.core.updater.UpdateType; @@ -23,14 +25,9 @@ public class MountTitan extends Mount { public MountTitan(MountManager manager) { - super(manager, "Molten Snake", Material.MAGMA_CREAM, (byte)0, new String[] - { - C.cWhite + "Deep under the earths surface, there", - C.cWhite + "exists a mythical species of Molten", - C.cWhite + "Snakes. This one will serve you eternally.", - " ", - C.cRed + "Unlocked with Titan Rank", - }, -1); + super(manager, "Molten Snake", Material.MAGMA_CREAM, (byte)0, + UtilText.splitLineToArray(C.cWhite + "Deep under the earths surface, there exists a mythical species of Molten Snakes. This one will serve you eternally.", LineFormat.LORE), + -13); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java index 3bf4bb80e..bd5bbd1af 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java @@ -8,7 +8,9 @@ import org.bukkit.entity.Horse.Variant; import org.bukkit.event.EventHandler; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilText; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.mount.HorseMount; @@ -21,12 +23,8 @@ public class MountUndead extends HorseMount { public MountUndead(MountManager manager) { - super(manager, "Infernal Horror", new String[] - { - C.cWhite + "The most ghastly horse in", - C.cWhite + "existance, from the pits of", - C.cWhite + "the Nether.", - }, + super(manager, "Infernal Horror", + UtilText.splitLineToArray(C.cWhite + "The most ghastly horse in existance, from the pits of the Nether.", LineFormat.LORE), Material.BONE, (byte)0, 20000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java index 9b396f6b5..e734e1df8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java @@ -6,6 +6,8 @@ import org.bukkit.entity.Horse.Style; import org.bukkit.entity.Horse.Variant; import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.mount.HorseMount; import mineplex.core.mount.MountManager; @@ -13,18 +15,11 @@ public class MountZombie extends HorseMount { public MountZombie(MountManager manager) { - super(manager, "Decrepit Warhorse", new String[] - { - C.cWhite + "Once a fierce warhorse, this", - C.cWhite + "undead beast will send fear", - C.cWhite + "into the hearts of your enemies.", - " ", - C.cYellow + "Earned by defeating the Pumpkin King", - C.cYellow + "in the 2015 Halloween Horror Event.", - }, + super(manager, "Decrepit Warhorse", + UtilText.splitLineToArray(C.cWhite + "Once a fierce warhorse, this undead beast will send fear into the hearts of your enemies.", LineFormat.LORE), Material.ROTTEN_FLESH, (byte)0, - -1, + -4, Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null); } } From 98e91d29f6ff143082b4bb66caf57783bf370efc Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 17:21:54 +1100 Subject: [PATCH 20/51] more cosmetic stuff :) --- .../src/mineplex/core/common/util/C.java | 2 ++ .../mineplex/core/common/util/LineFormat.java | 2 +- .../mineplex/core/common/util/UtilText.java | 15 ++++++++++++++ .../gadgets/arrowtrail/ArrowTrailTitan.java | 2 +- .../core/gadget/gadgets/death/DeathTitan.java | 2 +- .../gadgets/doublejump/DoubleJumpTitan.java | 2 +- .../core/gadget/gadgets/hat/HatGrinch.java | 20 +++++++++++++++++++ .../core/gadget/gadgets/morph/MorphBat.java | 8 ++++---- .../core/gadget/gadgets/morph/MorphBlaze.java | 4 ++-- .../core/gadget/gadgets/morph/MorphBlock.java | 6 +++--- .../core/gadget/gadgets/morph/MorphBunny.java | 10 +++++----- .../gadget/gadgets/morph/MorphChicken.java | 6 +++--- .../core/gadget/gadgets/morph/MorphCow.java | 4 ++-- .../gadget/gadgets/morph/MorphCreeper.java | 2 +- .../gadget/gadgets/morph/MorphEnderman.java | 4 ++-- .../core/gadget/gadgets/morph/MorphPig.java | 6 +++--- .../core/gadget/gadgets/morph/MorphSlime.java | 8 ++++---- .../gadget/gadgets/morph/MorphSnowman.java | 6 +++--- .../core/gadget/gadgets/morph/MorphTitan.java | 4 ++-- .../gadget/gadgets/morph/MorphVillager.java | 8 ++++---- .../gadget/gadgets/morph/MorphWither.java | 4 ++-- .../core/mount/types/MountSpider.java | 6 +++--- .../core/playerCount/PlayerCountManager.java | 4 ++-- 23 files changed, 86 insertions(+), 49 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/C.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/C.java index 7d5f00c91..bab76df51 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/C.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/C.java @@ -4,6 +4,8 @@ import org.bukkit.ChatColor; public class C { + public static final String blankLine = ChatColor.RESET + " "; + public static String Scramble = "§k"; public static String Bold = "§l"; public static String Strike = "§m"; diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/LineFormat.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/LineFormat.java index 8f5f7320e..2db7d259f 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/LineFormat.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/LineFormat.java @@ -2,7 +2,7 @@ package mineplex.core.common.util; public enum LineFormat { - LORE(200), CHAT(319); + LORE(220), CHAT(319); private int _length; diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java index aec40852a..38e540824 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilText.java @@ -295,6 +295,21 @@ public class UtilText public static ArrayList splitLine(String string, LineFormat lineFormat) { ArrayList strings = new ArrayList(); + + //Ignore lines with # + if (string.startsWith("#")) + { + strings.add(string.substring(1, string.length())); + return strings; + } + + //Empty + if (string.equals("") || string.equals(" ")) + { + strings.add(string); + return strings; + } + String current = ""; int currentLength = 0; String[] split = string.split(" "); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java index 773e5b677..eb9043ba5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java @@ -22,7 +22,7 @@ public class ArrowTrailTitan extends ArrowEffectGadget { super(manager, "Arrows of the Titans", UtilText.splitLineToArray(C.cWhite + "Arrows forged in the Fires of Creation, they leave fiery trails in their wake.", LineFormat.LORE), - -1, + -13, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java index 43c8b326d..52f7edda8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java @@ -18,7 +18,7 @@ public class DeathTitan extends DeathEffectGadget { super(manager, "Ashes of the Titans", UtilText.splitLineToArray(C.cWhite + "Even a Titan can fall in combat if their opponent is fierce enough.", LineFormat.LORE), - -1, + -13, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java index 7b75adf3d..c86fe06dc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -23,7 +23,7 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget { super(manager, "Leap of the Titans", UtilText.splitLineToArray(C.cWhite + "Out of the frying pan and into the fire.", LineFormat.LORE), - -1, + -13, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java new file mode 100644 index 000000000..502ff74cb --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java @@ -0,0 +1,20 @@ +package mineplex.core.gadget.gadgets.hat; + +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.HatGadget; + +public class HatGrinch extends HatGadget +{ + + public HatGrinch(GadgetManager manager) + { + super(manager, "The Grinch", + UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + -3, + "christmasgift"); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java index 039027011..febe7172e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java @@ -46,10 +46,10 @@ public class MorphBat extends MorphGadget implements IThrown UtilText.splitLinesToArray(new String[] { C.cWhite + "Flap around and annoy people by screeching loudly into their ears!", - " ", - C.cYellow + "Left-Click" + C.cGray + " to " + C.cGreen + "Screech", - C.cYellow + "Double Jump" + C.cGray + " to " + C.cGreen + "Flap", - C.cYellow + "Sneak" + C.cGray + " to " + C.cGreen + "Poop", + C.blankLine, + "#" + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Screech", + "#" + C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", + "#" + C.cYellow + "Sneak" + C.cGray + " to use " + C.cGreen + "Poop", }, LineFormat.LORE), 40000, Material.SKULL_ITEM, (byte)1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java index 2514a515f..62fc9d54b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java @@ -30,8 +30,8 @@ public class MorphBlaze extends MorphGadget UtilText.splitLinesToArray(new String[] { C.cWhite + "Transform into a fiery Blaze, straight from the Nether!", - " ", - C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Firefly", + C.blankLine, + "#" + C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Firefly", }, LineFormat.LORE), -11, Material.BLAZE_POWDER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java index 210e8aae5..2a99353b3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java @@ -37,9 +37,9 @@ public class MorphBlock extends MorphGadget super(manager, "Block Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "The blockiest block that ever blocked.", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Change Block", - C.cYellow + "Stay Still" + C.cGray + " to use " + C.cGreen + "Solidify", + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Change Block", + "#" + C.cYellow + "Stay Still" + C.cGray + " to use " + C.cGreen + "Solidify", }, LineFormat.LORE), 30000, Material.EMERALD_BLOCK, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java index 31e971ecc..8958d958a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java @@ -55,11 +55,11 @@ public class MorphBunny extends MorphGadget super(manager, "Easter Bunny Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Happy Easter!", - " ", - C.cYellow + "Charge Crouch" + C.cGray + " to use " + C.cGreen + "Super Jump", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg", - " ", - C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , + C.blankLine, + "#" + C.cYellow + "Charge Crouch" + C.cGray + " to use " + C.cGreen + "Super Jump", + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg", + C.blankLine, + "#" + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , }, LineFormat.LORE), -5, Material.MONSTER_EGG, (byte)98); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java index 2f782c036..5589776ba 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java @@ -38,9 +38,9 @@ public class MorphChicken extends MorphGadget super(manager, "Chicken Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Soar through the air like a fat Chicken!", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Egg Shot", - C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Egg Shot", + "#" + C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", }, LineFormat.LORE), 20000, Material.FEATHER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java index 70b56b04f..8c46bd98b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java @@ -23,8 +23,8 @@ public class MorphCow extends MorphGadget super(manager, "Cow Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "How now brown cow?", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Moo", + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Moo", }, LineFormat.LORE), 6000, Material.LEATHER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java index d6f4cd78f..cfe013647 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java @@ -38,7 +38,7 @@ public class MorphCreeper extends MorphGadget super(manager, "Creeper Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Become the creepiest of Creepers that ever creeped!", - " ", + C.blankLine, C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate", }, LineFormat.LORE), -11, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java index f5305b19f..a7c75fb33 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java @@ -34,8 +34,8 @@ public class MorphEnderman extends MorphGadget super(manager, "Enderman Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Using morph is the ultimate diet! Guaranteed instant results!", - " ", - C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Blink", + C.blankLine, + "#" + C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Blink", }, LineFormat.LORE), 30000, Material.ENDER_PEARL, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java index 65475ef7b..90cb4478e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java @@ -36,9 +36,9 @@ public class MorphPig extends MorphGadget super(manager, "Pig Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Oink. Oink. Oink.... Oink?", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink", - C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce", + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink", + "#" + C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce", }, LineFormat.LORE), -10, Material.PORK, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java index 6f0f8f89f..cd6b8b24e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java @@ -30,10 +30,10 @@ public class MorphSlime extends MorphGadget super(manager, "Big Larry Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Have you ever looked at Big Larry and thought, \'I really want to be that guy!\'? Well, today is your lucky day!", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Bounce", - " ", - C.cWhite + "+1 Slime Size for every 10 Mineplex Levels", + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Bounce", + C.blankLine, + "#" + C.cGreen + "+1 Size per 10 Mineplex Levels", }, LineFormat.LORE), 80000, Material.SLIME_BALL, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java index e9a4ee54c..bd06315e5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java @@ -47,9 +47,9 @@ public class MorphSnowman extends MorphGadget C.cWhite + "Do you wanna build a snowman?", C.cWhite + "It doesn't have to be a snowman...", C.cWhite + "Or... it kind of does...", - " ", - C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Blizzard", - C.cYellow + "Sneak" + C.cGray + " to use " + C.cGreen + "Snow Slide", + C.blankLine, + "#" + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Blizzard", + "#" + C.cYellow + "Sneak" + C.cGray + " to use " + C.cGreen + "Snow Slide", }, LineFormat.LORE), -3, Material.SNOW_BALL, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java index 91ba7a3f8..cedd467ee 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java @@ -47,8 +47,8 @@ public class MorphTitan extends MorphGadget super(manager, "Elder Guardian Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "From the depths of the sea, the Elder Guardian posseses powers more amazing than any seen before!", - " ", - C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Guardians Laser", + C.blankLine, + "#" + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Guardians Laser", }, LineFormat.LORE), -13, Material.PRISMARINE_CRYSTALS, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java index 3c537f731..61944df22 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java @@ -45,10 +45,10 @@ public class MorphVillager extends MorphGadget implements IThrown super(manager, "Villager Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "HURRRR! MURR HURRR!", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Gem Throw", - " ", - C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Gem Throw uses 20 Gems" + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Gem Throw", + C.blankLine, + "#" + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Gem Throw uses 20 Gems" }, LineFormat.LORE), 12000, Material.EMERALD, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java index 0bf2c6695..664b088f7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java @@ -48,8 +48,8 @@ public class MorphWither extends MorphGadget super(manager, "Wither Morph", UtilText.splitLinesToArray(new String[] { C.cWhite + "Legends have foretold the coming of a powerful Wither...", - " ", - C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull", + C.blankLine, + "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull", }, LineFormat.LORE), -12, Material.SKULL_ITEM, (byte)1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java index 0e4058aa4..c658c14e2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java @@ -47,9 +47,9 @@ public class MountSpider extends HorseMount UtilText.splitLinesToArray(new String[] { C.cWhite + "Why ride a horse when you can ride a cute and cuddly spider!", - C.cBlack, - C.cYellow + "Look Up" + C.cGray + " to use " + C.cGreen + "Wall Climb", - C.cYellow + "Jump" + C.cGray + " to use " + C.cGreen + "Leap", + C.blankLine, + "#" + C.cYellow + "Look Up" + C.cGray + " to use " + C.cGreen + "Wall Climb", + "#" + C.cYellow + "Jump" + C.cGray + " to use " + C.cGreen + "Leap", }, LineFormat.LORE), Material.WEB, (byte) 0, -4, Color.BLACK, Style.NONE, Variant.HORSE, 2.0, Material.AIR); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java b/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java index 826cf7636..71595c42a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/playerCount/PlayerCountManager.java @@ -19,7 +19,7 @@ public class PlayerCountManager extends MiniPlugin private DataRepository _repository; private DataRepository _secondRepository; - private volatile int _playerCount; + private volatile int _playerCount = 0; public PlayerCountManager(JavaPlugin plugin) { @@ -37,7 +37,7 @@ public class PlayerCountManager extends MiniPlugin _secondRepository = new RedisDataRepository(new ConnectionData("10.33.53.16", 6379, ConnectionData.ConnectionType.MASTER, "ServerStatus"), new ConnectionData("10.33.53.16", 6377, ConnectionData.ConnectionType.SLAVE, "ServerStatus"), Region.ALL, BungeeServer.class, "bungeeServers"); - updatePlayerCount(); + //updatePlayerCount(); } private void updatePlayerCount() From 66011cde8cbced8adf50b23ed833953cd16d2286 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 17:25:23 +1100 Subject: [PATCH 21/51] fixed player count --- Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 3583b5df5..52abd753e 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -697,6 +697,8 @@ public class HubManager extends MiniClientPlugin if (_scoreboardTick != 0) return; + int playerCount = _playerCountManager.getPlayerCount(); + for (Player player : UtilServer.getPlayers()) { //Dont Waste Time @@ -733,11 +735,10 @@ public class HubManager extends MiniClientPlugin obj.getScore(" ").setScore(line--); //Players - int playerCount = _playerCountManager.getPlayerCount(); obj.getScore(C.cYellow + C.Bold + "Players").setScore(line--); player.getScoreboard().resetScores(_lastPlayerCount + ""); obj.getScore(playerCount + "").setScore(line--); - _lastPlayerCount = playerCount; + //Space obj.getScore(" ").setScore(line--); @@ -770,6 +771,8 @@ public class HubManager extends MiniClientPlugin obj.getScore("www.mineplex.com").setScore(line--); obj.getScore("----------------").setScore(line--); } + + _lastPlayerCount = playerCount; } @Override From 61a8d2825e7fb01be56fa3f8f688e1694494a020 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 19:20:13 +1100 Subject: [PATCH 22/51] gadget gui overhaul --- .../core/cosmetic/ui/page/GadgetPage.java | 58 ++++++---- .../core/cosmetic/ui/page/MountPage.java | 89 +++++++++++++-- .../core/cosmetic/ui/page/PetPage.java | 105 +++++++++++++----- .../arrowtrail/ArrowTrailCandyCane.java | 2 +- .../arrowtrail/ArrowTrailFrostLord.java | 2 +- .../gadgets/arrowtrail/ArrowTrailTitan.java | 2 +- .../gadget/gadgets/death/DeathCandyCane.java | 2 +- .../gadget/gadgets/death/DeathFrostLord.java | 2 +- .../core/gadget/gadgets/death/DeathTitan.java | 2 +- .../doublejump/DoubleJumpCandyCane.java | 2 +- .../doublejump/DoubleJumpFrostLord.java | 2 +- .../gadgets/doublejump/DoubleJumpTitan.java | 2 +- .../core/gadget/gadgets/hat/HatCoal.java | 2 +- .../core/gadget/gadgets/hat/HatGrinch.java | 2 +- .../core/gadget/gadgets/hat/HatPresent.java | 2 +- .../core/gadget/gadgets/hat/HatSanta.java | 2 +- .../core/gadget/gadgets/hat/HatSnowman.java | 2 +- .../core/gadget/gadgets/item/ItemBatGun.java | 2 +- .../core/gadget/gadgets/item/ItemCoal.java | 2 +- .../core/gadget/gadgets/morph/MorphBat.java | 8 +- .../core/gadget/gadgets/morph/MorphBlaze.java | 4 +- .../core/gadget/gadgets/morph/MorphBlock.java | 6 +- .../core/gadget/gadgets/morph/MorphBunny.java | 6 +- .../gadget/gadgets/morph/MorphChicken.java | 6 +- .../core/gadget/gadgets/morph/MorphCow.java | 4 +- .../gadget/gadgets/morph/MorphCreeper.java | 4 +- .../gadget/gadgets/morph/MorphEnderman.java | 4 +- .../core/gadget/gadgets/morph/MorphPig.java | 6 +- .../gadgets/morph/MorphPumpkinKing.java | 2 +- .../core/gadget/gadgets/morph/MorphSlime.java | 6 +- .../gadget/gadgets/morph/MorphSnowman.java | 10 +- .../core/gadget/gadgets/morph/MorphTitan.java | 4 +- .../gadget/gadgets/morph/MorphVillager.java | 4 +- .../gadget/gadgets/morph/MorphWither.java | 4 +- .../gadgets/particle/ParticleCandyCane.java | 2 +- .../gadgets/particle/ParticleCoalFumes.java | 2 +- .../gadgets/particle/ParticleEnchant.java | 2 +- .../gadgets/particle/ParticleFairy.java | 6 +- .../gadgets/particle/ParticleFireRings.java | 2 +- .../gadget/gadgets/particle/ParticleFoot.java | 2 +- .../gadgets/particle/ParticleFrostLord.java | 2 +- .../gadgets/particle/ParticleGreen.java | 2 +- .../gadgets/particle/ParticleHeart.java | 2 +- .../gadgets/particle/ParticleHelix.java | 2 +- .../gadgets/particle/ParticleKronos.java | 6 +- .../gadgets/particle/ParticleLegend.java | 2 +- .../gadget/gadgets/particle/ParticleRain.java | 2 +- .../gadgets/particle/ParticleTitan.java | 2 +- .../core/mount/types/MountBabyReindeer.java | 2 +- .../mineplex/core/mount/types/MountCart.java | 2 +- .../core/mount/types/MountDragon.java | 2 +- .../mineplex/core/mount/types/MountFrost.java | 2 +- .../mineplex/core/mount/types/MountMule.java | 2 +- .../mineplex/core/mount/types/MountSheep.java | 2 +- .../mineplex/core/mount/types/MountSlime.java | 2 +- .../core/mount/types/MountSpider.java | 6 +- .../mineplex/core/mount/types/MountTitan.java | 2 +- .../core/mount/types/MountUndead.java | 2 +- .../core/mount/types/MountZombie.java | 2 +- .../src/mineplex/core/pet/PetFactory.java | 4 +- .../src/mineplex/core/pet/types/Elf.java | 2 +- .../src/mineplex/core/pet/types/Pumpkin.java | 2 +- 62 files changed, 283 insertions(+), 149 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 7370cb2ce..0d265f3ea 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -78,16 +78,10 @@ public class GadgetPage extends ShopPageBase List itemLore = new ArrayList(); - itemLore.add(C.cBlack); itemLore.addAll(Arrays.asList(gadget.GetDescription())); - - if (gadget.GetCost(CurrencyType.Coins) >= 0) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Cost: " + ChatColor.RESET + gadget.GetCost(CurrencyType.Coins) + " Treasure Shards"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -1) + + if (gadget.GetCost(CurrencyType.Coins) == -1) { //Nothing } @@ -95,22 +89,22 @@ public class GadgetPage extends ShopPageBase else if (gadget.GetCost(CurrencyType.Coins) == -2) { itemLore.add(C.cBlack); - itemLore.add(C.cGray + "Found in Treasure Chests"); + itemLore.add(C.cBlue + "Found in Treasure Chests"); } else if (gadget.GetCost(CurrencyType.Coins) == -3) { itemLore.add(C.cBlack); - itemLore.add(C.cWhite + "Found in Winter Holiday Treasure"); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); } else if (gadget.GetCost(CurrencyType.Coins) == -4) { itemLore.add(C.cBlack); - itemLore.add(C.cWhite + "Found in Halloween Pumpkin Treasure"); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); } else if (gadget.GetCost(CurrencyType.Coins) == -5) { itemLore.add(C.cBlack); - itemLore.add(C.cWhite + "Found in Easter Holiday Treasure"); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); } //Rank Unlocks else if (gadget.GetCost(CurrencyType.Coins) == -10) @@ -128,7 +122,7 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cGreen + "Unlocked with Legend Rank"); } - else if (gadget.GetCost(CurrencyType.Coins) == -12) + else if (gadget.GetCost(CurrencyType.Coins) == -13) { itemLore.add(C.cBlack); itemLore.add(C.cRed + "Unlocked with Titan Rank"); @@ -147,19 +141,45 @@ public class GadgetPage extends ShopPageBase { if (gadget.GetActive().contains(getPlayer())) { - addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Deactivate " + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateGadgetButton(gadget, this)); + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Disable"); + + addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateGadgetButton(gadget, this)); } else { - addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Activate " + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateGadgetButton(gadget, this)); + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Enable"); + + addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateGadgetButton(gadget, this)); } } - else - { + else + { + if (gadget.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.GetCost(CurrencyType.Coins) + " Treasure Shards"); + } + if (gadget.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= gadget.GetCost(CurrencyType.Coins)) - addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, (gadget.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new GadgetButton(gadget, this)); + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to craft " + gadget.GetName()); + + addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new GadgetButton(gadget, this)); + } + else if (gadget.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Not enough Treasure Shards."); + + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } else - setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, (gadget.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + { + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java index 2ed930507..77e87179c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java @@ -57,31 +57,100 @@ public class MountPage extends ShopPageBase { List itemLore = new ArrayList(); - if (mount.GetCost(CurrencyType.Coins) != -1) - { - itemLore.add(C.cYellow + mount.GetCost(CurrencyType.Coins) + " Coins"); - } - itemLore.add(C.cBlack); itemLore.addAll(Arrays.asList(mount.GetDescription())); + if (mount.GetCost(CurrencyType.Coins) == -1) + { + //Nothing + } + //Chest Unlocks + else if (mount.GetCost(CurrencyType.Coins) == -2) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (mount.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (mount.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (mount.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (mount.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } + + if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) { if (mount.GetActive().containsKey(getPlayer())) { - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Deactivate " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Disable"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); } else { - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Activate " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this)); + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Enable"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this)); } } else { - if (mount.GetCost(CurrencyType.Coins) != -1 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), (mount.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new MountButton(mount, this)); + if (mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.Coins) + " Treasure Shards"); + } + + if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to craft " + mount.GetName()); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this)); + } + else if (mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Not enough Treasure Shards."); + + setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } else - setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), (mount.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + { + setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index cd562f903..7d40cab01 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -61,26 +61,54 @@ public class PetPage extends ShopPageBase { List itemLore = new ArrayList(); - //Halloween Name + itemLore.add(C.cBlack); + itemLore.add(C.cGray + "Your very own " + pet.GetName() + "!"); + if (pet.GetCost(CurrencyType.Coins) == -1) { - if (pet instanceof Pumpkin) - { - itemLore.add(C.cBlack); - itemLore.add(ChatColor.RESET + C.cYellow + "Earned by defeating the Pumpkin King"); - itemLore.add(ChatColor.RESET + C.cYellow + "in the 2014 Halloween Horror Event."); - } - if (pet instanceof Elf) - { - itemLore.add(C.cBlack); - itemLore.add(ChatColor.RESET + C.cYellow + "Earned by defeating the Pumpkin King"); - itemLore.add(ChatColor.RESET + C.cYellow + "in the 2014 Christmas Chaos Event."); - } - if (pet.GetPetType() == EntityType.WITHER) - { - itemLore.add(C.cBlack); - itemLore.add(ChatColor.RESET + C.cGreen + "Unlocked with Legend Rank"); - } + //Nothing + } + //Chest Unlocks + else if (pet.GetCost(CurrencyType.Coins) == -2) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (pet.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (pet.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (pet.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (pet.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); } //Owned @@ -94,35 +122,52 @@ public class PetPage extends ShopPageBase if (getPlugin().getPetManager().hasActivePet(getPlayer().getName()) && getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() == pet.GetPetType()) { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Disable"); + addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.GetPetType().getTypeId(), - "Deactivate " + pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")", + pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivatePetButton(this, getPlugin().getPetManager())); addGlow(slot); } else { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Enable"); + addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.GetPetType().getTypeId(), - "Activate " + pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")", + pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivatePetButton(pet, this)); } } //Not Owned else { - //Cost Lore if (pet.GetCost(CurrencyType.Coins) > 0) - { - itemLore.add(C.cYellow + pet.GetCost(CurrencyType.Coins) + " Coins"); - itemLore.add(C.cBlack); - } + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + pet.GetCost(CurrencyType.Coins) + " Treasure Shards"); + } - if (pet.GetCost(CurrencyType.Coins) == -1) - setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); - else if (getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins)) - addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new PetButton(pet, this)); - else + if (pet.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins)) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to craft " + pet.GetName()); + + addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new PetButton(pet, this)); + } + else if (pet.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Not enough Treasure Shards."); + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + else + { + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } } slot++; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java index c02c7f4c5..0b4f11e18 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailCandyCane.java @@ -20,7 +20,7 @@ public class ArrowTrailCandyCane extends ArrowEffectGadget public ArrowTrailCandyCane(GadgetManager manager) { super(manager, "Candy Cane Arrows", - UtilText.splitLineToArray(C.cWhite + "The real reason no one visits the North Pole? Santa’s Elves are deadly shots.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "The real reason no one visits the North Pole? Santa’s Elves are deadly shots.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java index 8503deb02..171860cd5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailFrostLord.java @@ -18,7 +18,7 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget public ArrowTrailFrostLord(GadgetManager manager) { super(manager, "Arrows of the Frost Lord", - UtilText.splitLineToArray(C.cWhite + "The Frost Lord’s arrows bring a blast of winter in the wind of their passing.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "The Frost Lord’s arrows bring a blast of winter in the wind of their passing.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java index eb9043ba5..e84e26318 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/arrowtrail/ArrowTrailTitan.java @@ -21,7 +21,7 @@ public class ArrowTrailTitan extends ArrowEffectGadget public ArrowTrailTitan(GadgetManager manager) { super(manager, "Arrows of the Titans", - UtilText.splitLineToArray(C.cWhite + "Arrows forged in the Fires of Creation, they leave fiery trails in their wake.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Arrows forged in the Fires of Creation, they leave fiery trails in their wake.", LineFormat.LORE), -13, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java index 748accb1a..c677d638e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathCandyCane.java @@ -19,7 +19,7 @@ public class DeathCandyCane extends DeathEffectGadget public DeathCandyCane(GadgetManager manager) { super(manager, "Candy Cane Remains", - UtilText.splitLineToArray(C.cWhite + "The biggest enemy of the Holidays, is January.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "The biggest enemy of the Holidays, is January.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java index 2f6bd3b89..7e90ac02d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathFrostLord.java @@ -15,7 +15,7 @@ public class DeathFrostLord extends DeathEffectGadget public DeathFrostLord(GadgetManager manager) { super(manager, "Fall of the Frost Lord", - UtilText.splitLineToArray(C.cWhite + "The power of Winter must eventually give way to Spring.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "The power of Winter must eventually give way to Spring.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java index 52f7edda8..cce291dc1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/death/DeathTitan.java @@ -17,7 +17,7 @@ public class DeathTitan extends DeathEffectGadget public DeathTitan(GadgetManager manager) { super(manager, "Ashes of the Titans", - UtilText.splitLineToArray(C.cWhite + "Even a Titan can fall in combat if their opponent is fierce enough.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Even a Titan can fall in combat if their opponent is fierce enough.", LineFormat.LORE), -13, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java index b95ef4ff4..80afc825b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpCandyCane.java @@ -19,7 +19,7 @@ public class DoubleJumpCandyCane extends DoubleJumpEffectGadget public DoubleJumpCandyCane(GadgetManager manager) { super(manager, "Candy Cane Blast", - UtilText.splitLineToArray(C.cWhite + "It is said every time an elf jumps, bits of Candy Cane fall out of their pockets.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "It is said every time an elf jumps, bits of Candy Cane fall out of their pockets.", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java index 4291f9d94..64cc9f962 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpFrostLord.java @@ -18,7 +18,7 @@ public class DoubleJumpFrostLord extends DoubleJumpEffectGadget public DoubleJumpFrostLord(GadgetManager manager) { super(manager, "Gust of the Frost Lord", - UtilText.splitLineToArray(C.cWhite + "Listen, the Frost Lord is a very proper individual. Stop making fart jokes!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Listen, the Frost Lord is a very proper individual. Stop making fart jokes!", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java index c86fe06dc..31cf84cce 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/doublejump/DoubleJumpTitan.java @@ -22,7 +22,7 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget public DoubleJumpTitan(GadgetManager manager) { super(manager, "Leap of the Titans", - UtilText.splitLineToArray(C.cWhite + "Out of the frying pan and into the fire.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Out of the frying pan and into the fire.", LineFormat.LORE), -13, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java index a78b88736..9a39e59f5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java @@ -15,7 +15,7 @@ public class HatCoal extends HatGadget public HatCoal(GadgetManager manager) { super(manager, "Lump of Coal", - UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "When life gives you coal, make a wierd cube hat out it!", LineFormat.LORE), -3, new ItemStack(Material.COAL_BLOCK)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java index 502ff74cb..d48320d58 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java @@ -12,7 +12,7 @@ public class HatGrinch extends HatGadget public HatGrinch(GadgetManager manager) { super(manager, "The Grinch", - UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Grinchtastic", LineFormat.LORE), -3, "christmasgift"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java index 74005d330..16d6fdd2f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java @@ -12,7 +12,7 @@ public class HatPresent extends HatGadget public HatPresent(GadgetManager manager) { super(manager, "Present", - UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "WHAT IN THE PRESENT? Oh, it's just you...", LineFormat.LORE), -3, "christmasgift"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java index 067f603e5..fa572fed3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java @@ -12,7 +12,7 @@ public class HatSanta extends HatGadget public HatSanta(GadgetManager manager) { super(manager, "Santa", - UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Now you can work the Mall circuit!", LineFormat.LORE), -3, "Presents"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java index 1e6ab44a4..9d02dd720 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java @@ -12,7 +12,7 @@ public class HatSnowman extends HatGadget public HatSnowman(GadgetManager manager) { super(manager, "Snowmans Head", - UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Do you want to be a snowman?", LineFormat.LORE), -3, "snowman002"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java index 62b8b2b39..72af832fd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemBatGun.java @@ -40,7 +40,7 @@ public class ItemBatGun extends ItemGadget public ItemBatGun(GadgetManager manager) { super(manager, "Bat Blaster", - UtilText.splitLineToArray(C.cWhite + "Unleash waves of terrifying bats at people you don't like!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Unleash waves of terrifying bats at people you don't like!", LineFormat.LORE), -1, Material.IRON_BARDING, (byte)0, 5000, new Ammo("Bat Blaster", "50 Bats", Material.IRON_BARDING, (byte)0, new String[] { C.cWhite + "50 Bats for your Bat Blaster!" }, 500, 50)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 098d136ff..157ed982b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -43,7 +43,7 @@ public class ItemCoal extends ItemGadget public ItemCoal(GadgetManager manager) { super(manager, "Coal", - UtilText.splitLineToArray(C.cWhite + "", LineFormat.LORE) + UtilText.splitLineToArray(C.cGray + "", LineFormat.LORE) , -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] { C.cDGray + "Exclusive Coal!", diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java index febe7172e..c6a61b789 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java @@ -45,11 +45,11 @@ public class MorphBat extends MorphGadget implements IThrown super(manager, "Bat Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Flap around and annoy people by screeching loudly into their ears!", + C.cGray + "Flap around and annoy people by screeching loudly into their ears!", C.blankLine, - "#" + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Screech", - "#" + C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", - "#" + C.cYellow + "Sneak" + C.cGray + " to use " + C.cGreen + "Poop", + "#" + C.cWhite + "Left-Click to use Screech", + "#" + C.cWhite + "Double Jump to use Flap", + "#" + C.cWhite + "Sneak to use Poop", }, LineFormat.LORE), 40000, Material.SKULL_ITEM, (byte)1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java index 62fc9d54b..1ea72b7e4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlaze.java @@ -29,9 +29,9 @@ public class MorphBlaze extends MorphGadget super(manager, "Blaze Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Transform into a fiery Blaze, straight from the Nether!", + C.cGray + "Transform into a fiery Blaze, straight from the Nether!", C.blankLine, - "#" + C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Firefly", + "#" + C.cWhite + "Crouch to use Firefly", }, LineFormat.LORE), -11, Material.BLAZE_POWDER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java index 2a99353b3..dea95636a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBlock.java @@ -36,10 +36,10 @@ public class MorphBlock extends MorphGadget { super(manager, "Block Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "The blockiest block that ever blocked.", + C.cGray + "The blockiest block that ever blocked.", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Change Block", - "#" + C.cYellow + "Stay Still" + C.cGray + " to use " + C.cGreen + "Solidify", + "#" + C.cWhite + "Left Click to use Change Block", + "#" + C.cWhite + "Stay Still to use Solidify", }, LineFormat.LORE), 30000, Material.EMERALD_BLOCK, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java index 8958d958a..55f67dc0d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBunny.java @@ -54,10 +54,10 @@ public class MorphBunny extends MorphGadget { super(manager, "Easter Bunny Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Happy Easter!", + C.cGray + "Happy Easter!", C.blankLine, - "#" + C.cYellow + "Charge Crouch" + C.cGray + " to use " + C.cGreen + "Super Jump", - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg", + "#" + C.cWhite + "Charge Crouch to use Super Jump", + "#" + C.cWhite + "Left Click to use Hide Easter Egg", C.blankLine, "#" + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" , }, LineFormat.LORE), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java index 5589776ba..5d989f5e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphChicken.java @@ -37,10 +37,10 @@ public class MorphChicken extends MorphGadget { super(manager, "Chicken Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Soar through the air like a fat Chicken!", + C.cGray + "Soar through the air like a fat Chicken!", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Egg Shot", - "#" + C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap", + "#" + C.cWhite + "Left Click to use Egg Shot", + "#" + C.cWhite + "Double Jump to use Flap", }, LineFormat.LORE), 20000, Material.FEATHER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java index 8c46bd98b..95ce07b35 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCow.java @@ -22,9 +22,9 @@ public class MorphCow extends MorphGadget { super(manager, "Cow Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "How now brown cow?", + C.cGray + "How now brown cow?", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Moo", + "#" + C.cWhite + "Left Click to use Moo", }, LineFormat.LORE), 6000, Material.LEATHER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java index cfe013647..ee5a33290 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphCreeper.java @@ -37,9 +37,9 @@ public class MorphCreeper extends MorphGadget { super(manager, "Creeper Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Become the creepiest of Creepers that ever creeped!", + C.cGray + "Become the creepiest of Creepers that ever creeped!", C.blankLine, - C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate", + C.cWhite + "Crouch to use Detonate", }, LineFormat.LORE), -11, Material.SKULL_ITEM, (byte)4); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java index a7c75fb33..b833b52bb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphEnderman.java @@ -33,9 +33,9 @@ public class MorphEnderman extends MorphGadget { super(manager, "Enderman Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Using morph is the ultimate diet! Guaranteed instant results!", + C.cGray + "Using this morph is the ultimate diet! Guaranteed instant results!", C.blankLine, - "#" + C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Blink", + "#" + C.cWhite + "Double Jump to use Blink", }, LineFormat.LORE), 30000, Material.ENDER_PEARL, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java index 90cb4478e..59ed09fa0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPig.java @@ -35,10 +35,10 @@ public class MorphPig extends MorphGadget { super(manager, "Pig Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Oink. Oink. Oink.... Oink?", + C.cGray + "Oink. Oink. Oink.... Oink?", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink", - "#" + C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce", + "#" + C.cWhite + "Left Click to use Oink", + "#" + C.cWhite + "Collide to use Pig Bounce", }, LineFormat.LORE), -10, Material.PORK, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java index cf0016bbb..ed425a5de 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphPumpkinKing.java @@ -21,7 +21,7 @@ public class MorphPumpkinKing extends MorphGadget { super(manager, "Pumpkin Kings Head", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Transforms the wearer into the dreaded Pumpkin King!", + C.cGray + "Transforms the wearer into the dreaded Pumpkin King!", }, LineFormat.LORE), -4, Material.PUMPKIN, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java index cd6b8b24e..7a8430173 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSlime.java @@ -29,11 +29,11 @@ public class MorphSlime extends MorphGadget { super(manager, "Big Larry Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Have you ever looked at Big Larry and thought, \'I really want to be that guy!\'? Well, today is your lucky day!", + C.cGray + "Have you ever looked at Big Larry and thought, \'I really want to be that guy!\'? Well, today is your lucky day!", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Bounce", + "#" + C.cWhite + "Left Click to use Bounce", C.blankLine, - "#" + C.cGreen + "+1 Size per 10 Mineplex Levels", + "#" + C.cWhite + "+1 Size per 10 Mineplex Levels", }, LineFormat.LORE), 80000, Material.SLIME_BALL, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java index bd06315e5..75e5ad743 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSnowman.java @@ -44,12 +44,12 @@ public class MorphSnowman extends MorphGadget super(manager, "Olaf Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Do you wanna build a snowman?", - C.cWhite + "It doesn't have to be a snowman...", - C.cWhite + "Or... it kind of does...", + C.cGray + "Do you wanna build a snowman?", + C.cGray + "It doesn't have to be a snowman...", + C.cGray + "Or... it kind of does...", C.blankLine, - "#" + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Blizzard", - "#" + C.cYellow + "Sneak" + C.cGray + " to use " + C.cGreen + "Snow Slide", + "#" + C.cWhite + "Left-Click to use Blizzard", + "#" + C.cWhite + "Sneak to use Snow Slide", }, LineFormat.LORE), -3, Material.SNOW_BALL, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java index cedd467ee..13fe0ee14 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java @@ -46,9 +46,9 @@ public class MorphTitan extends MorphGadget { super(manager, "Elder Guardian Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "From the depths of the sea, the Elder Guardian posseses powers more amazing than any seen before!", + C.cGray + "From the depths of the sea, the Elder Guardian posseses powers more amazing than any seen before!", C.blankLine, - "#" + C.cYellow + "Left-Click" + C.cGray + " to use " + C.cGreen + "Guardians Laser", + "#" + C.cWhite + "Left-Click to use Guardians Laser", }, LineFormat.LORE), -13, Material.PRISMARINE_CRYSTALS, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java index 61944df22..f327f0551 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java @@ -44,9 +44,9 @@ public class MorphVillager extends MorphGadget implements IThrown { super(manager, "Villager Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "HURRRR! MURR HURRR!", + C.cGray + "HURRRR! MURR HURRR!", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Gem Throw", + "#" + C.cWhite + "Left Click to use Gem Throw", C.blankLine, "#" + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Gem Throw uses 20 Gems" }, LineFormat.LORE), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java index 664b088f7..a2d68070f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphWither.java @@ -47,9 +47,9 @@ public class MorphWither extends MorphGadget { super(manager, "Wither Morph", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Legends have foretold the coming of a powerful Wither...", + C.cGray + "Legends have foretold the coming of a powerful Wither...", C.blankLine, - "#" + C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull", + "#" + C.cWhite + "Left Click to use Wither Skull", }, LineFormat.LORE), -12, Material.SKULL_ITEM, (byte)1); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java index 557bdfd95..95d5e746f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java @@ -29,7 +29,7 @@ public class ParticleCandyCane extends ParticleGadget public ParticleCandyCane(GadgetManager manager) { super(manager, "Crushed Candy Cane", - UtilText.splitLineToArray(C.cWhite + "There’s no such thing as too much Christmas Candy. Don’t listen to your dentist.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "There’s no such thing as too much Christmas Candy. Don’t listen to your dentist.", LineFormat.LORE), -3, Material.CHEST, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java index 03f93f17d..d81c1c6f3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java @@ -21,7 +21,7 @@ public class ParticleCoalFumes extends ParticleGadget public ParticleCoalFumes(GadgetManager manager) { super(manager, "Coal Fumes", - UtilText.splitLineToArray(C.cWhite + "Being on the Naughty List does have some perks... if you love coal, that is...", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Being on the Naughty List does have some perks... if you love coal, that is...", LineFormat.LORE), -1, Material.COAL, (byte) 0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java index a388a0d3d..230705505 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleEnchant.java @@ -22,7 +22,7 @@ public class ParticleEnchant extends ParticleGadget public ParticleEnchant(GadgetManager manager) { super(manager, "Enchanted", - UtilText.splitLineToArray(C.cWhite + "The wisdom of the universe suddenly find you extremely attractive, and wants to \'enchant\' you.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "The wisdom of the universe suddenly find you extremely attractive, and wants to \'enchant\' you.", LineFormat.LORE), -2, Material.BOOK, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java index 742355fe0..5bc8b9381 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFairy.java @@ -23,9 +23,9 @@ public class ParticleFairy extends ParticleGadget { super(manager, "Flame Fairy", new String[] { - C.cWhite + "HEY! LISTEN!", - C.cWhite + "HEY! LISTEN!", - C.cWhite + "HEY! LISTEN!", + C.cGray + "HEY! LISTEN!", + C.cGray + "HEY! LISTEN!", + C.cGray + "HEY! LISTEN!", }, -2, Material.BLAZE_POWDER, (byte)0); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java index 0de43a6da..99a79c36d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFireRings.java @@ -24,7 +24,7 @@ public class ParticleFireRings extends ParticleGadget public ParticleFireRings(GadgetManager manager) { super(manager, "Flame Rings", - UtilText.splitLineToArray(C.cWhite + "Forged from the blazing rods of 1000 Blazes by the infamous Nether King.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Forged from the blazing rods of 1000 Blazes by the infamous Nether King.", LineFormat.LORE), -2, Material.BLAZE_POWDER, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java index af9fd1155..44448a375 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFoot.java @@ -38,7 +38,7 @@ public class ParticleFoot extends ParticleGadget public ParticleFoot(GadgetManager manager) { super(manager, "Shadow Walk", - UtilText.splitLineToArray(C.cWhite + "In a world where footprints do not exist, leaving your shadow behind is the next best thing!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "In a world where footprints do not exist, leaving your shadow behind is the next best thing!", LineFormat.LORE), -2, Material.LEATHER_BOOTS, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index 3155b40af..faa25065f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -28,7 +28,7 @@ public class ParticleFrostLord extends ParticleGadget public ParticleFrostLord(GadgetManager manager) { super(manager, "Wind of the Frost Lord", - UtilText.splitLineToArray(C.cWhite + "He’s not passing wind okay? HE HAS A CONDITION!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "He’s not passing wind okay? HE HAS A CONDITION!", LineFormat.LORE), -3, Material.SNOW_BALL, (byte)0, "Frost Lord"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java index 1a524c676..a9bd2739d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleGreen.java @@ -24,7 +24,7 @@ public class ParticleGreen extends ParticleGadget public ParticleGreen(GadgetManager manager) { super(manager, "Green Ring", - UtilText.splitLineToArray(C.cWhite + "With these sparkles, you can sparkle while sparkle with CaptainSparklez!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "With these sparkles, you can sparkle while sparkle with CaptainSparklez!", LineFormat.LORE), -2, Material.EMERALD, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java index 64ddaf216..d07a2b01a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHeart.java @@ -34,7 +34,7 @@ public class ParticleHeart extends ParticleGadget { public ParticleHeart(GadgetManager manager) { super(manager, "I Heart You", - UtilText.splitLineToArray(C.cWhite + "Show off how much you love Mineplex and everyone on it!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Show off how much you love Mineplex and everyone on it!", LineFormat.LORE), -2, Material.APPLE, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java index 7ccaed9c4..a9336927b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHelix.java @@ -24,7 +24,7 @@ public class ParticleHelix extends ParticleGadget public ParticleHelix(GadgetManager manager) { super(manager, "Blood Helix", - UtilText.splitLineToArray(C.cWhite + "Blood magic is very dangerous... but also very cool!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Blood magic is very dangerous... but also very cool!", LineFormat.LORE), -2, Material.REDSTONE, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java index 02ed4ac3b..733424255 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleKronos.java @@ -25,9 +25,9 @@ public class ParticleKronos extends ParticleGadget { super(manager, "Titanic Aura", new String[] { - C.cWhite + "A symbol of Titan power", - C.cWhite + "whos ancestry traces back to Kronos,", - C.cWhite + "Titan Lord of Time.", + C.cGray + "A symbol of Titan power", + C.cGray + "whos ancestry traces back to Kronos,", + C.cGray + "Titan Lord of Time.", " ", C.cRed + "???" //When purchasable: C.cRed + "Unlocked with Titan Rank" diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java index 329e15b6b..6d48bb67d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleLegend.java @@ -22,7 +22,7 @@ public class ParticleLegend extends ParticleGadget public ParticleLegend(GadgetManager manager) { super(manager, "Legendary Aura", - UtilText.splitLineToArray(C.cWhite + "This particle will be updated soon! Yay!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "This particle will be updated soon! Yay!", LineFormat.LORE), -1, Material.ENDER_PORTAL_FRAME, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java index 068cd7db7..0e0b43109 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleRain.java @@ -24,7 +24,7 @@ public class ParticleRain extends ParticleGadget public ParticleRain(GadgetManager manager) { super(manager, "Rain Cloud", - UtilText.splitLineToArray(C.cWhite + "Bring your sadness wherever you go, with your very own portable rain cloud!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Bring your sadness wherever you go, with your very own portable rain cloud!", LineFormat.LORE), -2, Material.INK_SACK, (byte)4); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index 49724dfbe..d8270ec62 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -27,7 +27,7 @@ public class ParticleTitan extends ParticleGadget public ParticleTitan(GadgetManager manager) { super(manager, "Flame of the Titans", - UtilText.splitLineToArray(C.cWhite + "These flames are said to be the spirit of a Titan.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "These flames are said to be the spirit of a Titan.", LineFormat.LORE), -1, Material.FIREBALL, (byte)0); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java index f5e7eef9b..e126889f4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java @@ -32,7 +32,7 @@ public class MountBabyReindeer extends HorseMount public MountBabyReindeer(MountManager manager) { super(manager, "Baby Rainder", - UtilText.splitLineToArray(C.cWhite + "One of Santas baby reindeers. He's still learning how to fly...", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "One of Santas baby reindeers. He's still learning how to fly...", LineFormat.LORE), Material.SNOW_BALL, (byte) 0, -3, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java index 144289439..3af133864 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountCart.java @@ -32,7 +32,7 @@ public class MountCart extends Mount> public MountCart(MountManager manager) { super(manager, "Minecart", Material.MINECART, (byte)0, - UtilText.splitLineToArray(C.cWhite + "Cruise around town in your shiny new Minecart RX Turbo!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Cruise around town in your shiny new Minecart RX Turbo!", LineFormat.LORE), 15000); KnownPackage = false; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java index 0bdddc6be..918585528 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountDragon.java @@ -27,7 +27,7 @@ public class MountDragon extends DragonMount public MountDragon(MountManager manager) { super(manager, "Ethereal Dragon", - UtilText.splitLineToArray(C.cWhite + "From the distant Ether Realm, this prized dragon is said to only obey true Heroes!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "From the distant Ether Realm, this prized dragon is said to only obey true Heroes!", LineFormat.LORE), Material.DRAGON_EGG, (byte)0, -11); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java index 6b978f050..5a8617699 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountFrost.java @@ -24,7 +24,7 @@ public class MountFrost extends HorseMount public MountFrost(MountManager manager) { super(manager, "Glacial Steed", - UtilText.splitLineToArray(C.cWhite + "Born in the North Pole, it leaves a trail of frost as it moves!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Born in the North Pole, it leaves a trail of frost as it moves!", LineFormat.LORE), Material.SNOW_BALL, (byte)0, 15000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java index d8536e772..cecedd632 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountMule.java @@ -17,7 +17,7 @@ public class MountMule extends HorseMount public MountMule(MountManager manager) { super(manager, "Mount Mule", - UtilText.splitLineToArray(C.cWhite + "Your very own trusty pack mule!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Your very own trusty pack mule!", LineFormat.LORE), Material.HAY_BLOCK, (byte)0, 3000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java index f3b84ce99..7cecd08b0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSheep.java @@ -29,7 +29,7 @@ public class MountSheep extends HorseMount public MountSheep(MountManager manager) { super(manager, "Techno Sheep", - UtilText.splitLineToArray(C.cWhite + "Baaaaa with all the colors of the rainbow!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Baaaaa with all the colors of the rainbow!", LineFormat.LORE), Material.WOOL, (byte)14, 3000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java index 37b418d1a..92e90a12b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSlime.java @@ -32,7 +32,7 @@ public class MountSlime extends Mount> public MountSlime(MountManager manager) { super(manager, "Slime Mount", Material.SLIME_BALL, (byte)0, - UtilText.splitLineToArray(C.cWhite + "Bounce around on your very own slime friend!", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Bounce around on your very own slime friend!", LineFormat.LORE), 15000); KnownPackage = false; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java index c658c14e2..25884d4b2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountSpider.java @@ -46,10 +46,10 @@ public class MountSpider extends HorseMount super(manager, "Spider Mount", UtilText.splitLinesToArray(new String[] { - C.cWhite + "Why ride a horse when you can ride a cute and cuddly spider!", + C.cGray + "Why ride a horse when you can ride a cute and cuddly spider!", C.blankLine, - "#" + C.cYellow + "Look Up" + C.cGray + " to use " + C.cGreen + "Wall Climb", - "#" + C.cYellow + "Jump" + C.cGray + " to use " + C.cGreen + "Leap", + "#" + C.cWhite + "Look Up to use Wall Climb", + "#" + C.cWhite + "Jump to use Leap", }, LineFormat.LORE), Material.WEB, (byte) 0, -4, Color.BLACK, Style.NONE, Variant.HORSE, 2.0, Material.AIR); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java index 89927e4d1..5e9747e8d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountTitan.java @@ -26,7 +26,7 @@ public class MountTitan extends Mount public MountTitan(MountManager manager) { super(manager, "Molten Snake", Material.MAGMA_CREAM, (byte)0, - UtilText.splitLineToArray(C.cWhite + "Deep under the earths surface, there exists a mythical species of Molten Snakes. This one will serve you eternally.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Deep under the earths surface, there exists a mythical species of Molten Snakes. This one will serve you eternally.", LineFormat.LORE), -13); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java index bd5bbd1af..fead4b102 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountUndead.java @@ -24,7 +24,7 @@ public class MountUndead extends HorseMount public MountUndead(MountManager manager) { super(manager, "Infernal Horror", - UtilText.splitLineToArray(C.cWhite + "The most ghastly horse in existance, from the pits of the Nether.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "The most ghastly horse in existance, from the pits of the Nether.", LineFormat.LORE), Material.BONE, (byte)0, 20000, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java index e734e1df8..949a50f23 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountZombie.java @@ -16,7 +16,7 @@ public class MountZombie extends HorseMount public MountZombie(MountManager manager) { super(manager, "Decrepit Warhorse", - UtilText.splitLineToArray(C.cWhite + "Once a fierce warhorse, this undead beast will send fear into the hearts of your enemies.", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Once a fierce warhorse, this undead beast will send fear into the hearts of your enemies.", LineFormat.LORE), Material.ROTTEN_FLESH, (byte)0, -4, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java index de3a66e5e..71048a36c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/PetFactory.java @@ -39,8 +39,8 @@ public class PetFactory _pets.put(EntityType.WOLF, new Pet("Dog", EntityType.WOLF, 8000)); _pets.put(EntityType.OCELOT, new Pet("Cat", EntityType.OCELOT, 6000)); _pets.put(EntityType.MUSHROOM_COW, new Pet("Mooshroom", EntityType.MUSHROOM_COW, 5000)); - _pets.put(EntityType.WITHER, new Pet("Widder", EntityType.WITHER, -1)); - _pets.put(EntityType.SKELETON, new Pet("Guardian", EntityType.SKELETON, -1)); + _pets.put(EntityType.WITHER, new Pet("Widder", EntityType.WITHER, -12)); + _pets.put(EntityType.SKELETON, new Pet("Guardian", EntityType.SKELETON, -13)); } private void CreatePetExtras() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Elf.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Elf.java index 6a67a37ea..9f3e3c3ee 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Elf.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Elf.java @@ -8,7 +8,7 @@ public class Elf extends Pet { public Elf() { - super("Christmas Elf", EntityType.VILLAGER, -1); + super("Christmas Elf", EntityType.VILLAGER, -4); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Pumpkin.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Pumpkin.java index 71b561f2c..a2f3acc17 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Pumpkin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/Pumpkin.java @@ -8,6 +8,6 @@ public class Pumpkin extends Pet { public Pumpkin() { - super("Pumpling", EntityType.ZOMBIE, -1); + super("Pumpling", EntityType.ZOMBIE, -5); } } From d8a5edf9e94e2a793354f830d98d21af80b41d98 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 19:24:19 +1100 Subject: [PATCH 23/51] fixed up gui items --- .../src/mineplex/core/cosmetic/ui/page/GadgetPage.java | 2 +- .../src/mineplex/core/cosmetic/ui/page/MountPage.java | 2 +- .../src/mineplex/core/cosmetic/ui/page/PetPage.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 0d265f3ea..595ab5a17 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -165,7 +165,7 @@ public class GadgetPage extends ShopPageBase if (gadget.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= gadget.GetCost(CurrencyType.Coins)) { itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to craft " + gadget.GetName()); + itemLore.add(C.cGreen + "Click to Purchase"); addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new GadgetButton(gadget, this)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java index 77e87179c..fa7b1c76a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java @@ -136,7 +136,7 @@ public class MountPage extends ShopPageBase if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) { itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to craft " + mount.GetName()); + itemLore.add(C.cGreen + "Click to Purchase"); addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 7d40cab01..0d3ac5bf6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -153,7 +153,7 @@ public class PetPage extends ShopPageBase if (pet.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins)) { itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to craft " + pet.GetName()); + itemLore.add(C.cGreen + "Click to Purchase"); addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new PetButton(pet, this)); } @@ -162,7 +162,7 @@ public class PetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cRed + "Not enough Treasure Shards."); - setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); } else { From a6f664006f2f1c379331d4714a9ad55865bd1964 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 20:01:54 +1100 Subject: [PATCH 24/51] set display in gui --- .../core/cosmetic/ui/page/GadgetPage.java | 100 ++++--- .../core/cosmetic/ui/page/MountPage.java | 245 +++++++++--------- .../core/cosmetic/ui/page/PetPage.java | 93 +++---- .../mineplex/core/gadget/GadgetManager.java | 4 + .../core/gadget/gadgets/hat/HatGrinch.java | 2 +- .../core/gadget/set/SetCandyCane.java | 38 +++ .../mineplex/core/gadget/set/SetTitan.java | 38 +++ .../mineplex/core/gadget/types/Gadget.java | 15 +- .../mineplex/core/gadget/types/GadgetSet.java | 5 + 9 files changed, 330 insertions(+), 210 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 595ab5a17..3746ce66d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -81,51 +81,67 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.addAll(Arrays.asList(gadget.GetDescription())); - if (gadget.GetCost(CurrencyType.Coins) == -1) + if (!gadget.ownsGadget(getPlayer())) { - //Nothing + if (gadget.GetCost(CurrencyType.Coins) == -1) + { + //Nothing + } + //Chest Unlocks + else if (gadget.GetCost(CurrencyType.Coins) == -2 || gadget.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (gadget.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (gadget.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } } - //Chest Unlocks - else if (gadget.GetCost(CurrencyType.Coins) == -2) + else { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Treasure Chests"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -3) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -4) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -5) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); - } - //Rank Unlocks - else if (gadget.GetCost(CurrencyType.Coins) == -10) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -11) - { - itemLore.add(C.cBlack); - itemLore.add(C.cPurple + "Unlocked with Hero Rank"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -12) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Unlocked with Legend Rank"); - } - else if (gadget.GetCost(CurrencyType.Coins) == -13) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Unlocked with Titan Rank"); + if (gadget.getSet() != null) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGray + "Set Cosmetics;"); + + for (Gadget cur : gadget.getSet()) + { + itemLore.add(" "+ (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName()); + } + } } if (gadget instanceof ItemGadget) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java index fa7b1c76a..356635962 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/MountPage.java @@ -24,134 +24,137 @@ import mineplex.core.shop.page.ShopPageBase; public class MountPage extends ShopPageBase { - public MountPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) - { - super(plugin, shop, clientManager, donationManager, name, player, 54); - - buildPage(); - } - - protected void buildPage() - { - int slot = 19; - - for (Mount mount : getPlugin().getMountManager().getMounts()) - { - addMount(mount, slot); - slot++; - - if (slot == 26) - slot = 28; - } - - addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() + public MountPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player) + { + super(plugin, shop, clientManager, donationManager, name, player, 54); + + buildPage(); + } + + protected void buildPage() + { + int slot = 19; + + for (Mount mount : getPlugin().getMountManager().getMounts()) + { + addMount(mount, slot); + slot++; + + if (slot == 26) + slot = 28; + } + + addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton() { public void onClick(Player player, ClickType clickType) { getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player)); } }); - } - - protected void addMount(Mount mount, int slot) - { - List itemLore = new ArrayList(); - - itemLore.add(C.cBlack); - itemLore.addAll(Arrays.asList(mount.GetDescription())); - - if (mount.GetCost(CurrencyType.Coins) == -1) - { - //Nothing - } - //Chest Unlocks - else if (mount.GetCost(CurrencyType.Coins) == -2) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Treasure Chests"); - } - else if (mount.GetCost(CurrencyType.Coins) == -3) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); - } - else if (mount.GetCost(CurrencyType.Coins) == -4) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); - } - else if (mount.GetCost(CurrencyType.Coins) == -5) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); - } - //Rank Unlocks - else if (mount.GetCost(CurrencyType.Coins) == -10) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); - } - else if (mount.GetCost(CurrencyType.Coins) == -11) - { - itemLore.add(C.cBlack); - itemLore.add(C.cPurple + "Unlocked with Hero Rank"); - } - else if (mount.GetCost(CurrencyType.Coins) == -12) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Unlocked with Legend Rank"); - } - else if (mount.GetCost(CurrencyType.Coins) == -13) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Unlocked with Titan Rank"); - } - + } - if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) - { - if (mount.GetActive().containsKey(getPlayer())) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to Disable"); - - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); - } - else - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to Enable"); - - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this)); - } - } - else - { - if (mount.GetCost(CurrencyType.Coins) > 0) + protected void addMount(Mount mount, int slot) + { + List itemLore = new ArrayList(); + + itemLore.add(C.cBlack); + itemLore.addAll(Arrays.asList(mount.GetDescription())); + + if (!getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) + { + if (mount.GetCost(CurrencyType.Coins) == -1) { - itemLore.add(C.cBlack); - itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.Coins) + " Treasure Shards"); + //Nothing } - - if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Click to Purchase"); - - addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this)); - } - else if (mount.GetCost(CurrencyType.Coins) > 0) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Not enough Treasure Shards."); - - setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); - } - else - { - setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); - } - } - - } + //Chest Unlocks + else if (mount.GetCost(CurrencyType.Coins) == -2 || mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (mount.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (mount.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (mount.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + //Rank Unlocks + else if (mount.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (mount.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } + } + + + if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName())) + { + if (mount.GetActive().containsKey(getPlayer())) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Disable"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this)); + } + else + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Enable"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this)); + } + } + else + { + if (mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.Coins) + " Treasure Shards"); + } + + if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins)) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Purchase"); + + addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this)); + } + else if (mount.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Not enough Treasure Shards."); + + setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + else + { + setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); + } + } + + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java index 0d3ac5bf6..4e796c47e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetPage.java @@ -64,52 +64,57 @@ public class PetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.add(C.cGray + "Your very own " + pet.GetName() + "!"); - if (pet.GetCost(CurrencyType.Coins) == -1) - { - //Nothing - } //Chest Unlocks - else if (pet.GetCost(CurrencyType.Coins) == -2) + if (!getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Treasure Chests"); - } - else if (pet.GetCost(CurrencyType.Coins) == -3) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); - } - else if (pet.GetCost(CurrencyType.Coins) == -4) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); - } - else if (pet.GetCost(CurrencyType.Coins) == -5) - { - itemLore.add(C.cBlack); - itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); - } - //Rank Unlocks - else if (pet.GetCost(CurrencyType.Coins) == -10) - { - itemLore.add(C.cBlack); - itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); - } - else if (pet.GetCost(CurrencyType.Coins) == -11) - { - itemLore.add(C.cBlack); - itemLore.add(C.cPurple + "Unlocked with Hero Rank"); - } - else if (pet.GetCost(CurrencyType.Coins) == -12) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Unlocked with Legend Rank"); - } - else if (pet.GetCost(CurrencyType.Coins) == -13) - { - itemLore.add(C.cBlack); - itemLore.add(C.cRed + "Unlocked with Titan Rank"); - } + if (pet.GetCost(CurrencyType.Coins) == -1) + { + //Nothing + } + + else if (pet.GetCost(CurrencyType.Coins) == -2 || pet.GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Treasure Chests"); + } + else if (pet.GetCost(CurrencyType.Coins) == -3) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Winter Holiday Treasure"); + } + else if (pet.GetCost(CurrencyType.Coins) == -4) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure"); + } + else if (pet.GetCost(CurrencyType.Coins) == -5) + { + itemLore.add(C.cBlack); + itemLore.add(C.cBlue + "Found in Easter Holiday Treasure"); + } + + //Rank Unlocks + else if (pet.GetCost(CurrencyType.Coins) == -10) + { + itemLore.add(C.cBlack); + itemLore.add(C.cAqua + "Unlocked with Ultra Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -11) + { + itemLore.add(C.cBlack); + itemLore.add(C.cPurple + "Unlocked with Hero Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -12) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Unlocked with Legend Rank"); + } + else if (pet.GetCost(CurrencyType.Coins) == -13) + { + itemLore.add(C.cBlack); + itemLore.add(C.cRed + "Unlocked with Titan Rank"); + } + } //Owned if (getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 4f1852000..c817ad7c5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -90,7 +90,9 @@ import mineplex.core.gadget.gadgets.particle.ParticleHelix; import mineplex.core.gadget.gadgets.particle.ParticleLegend; import mineplex.core.gadget.gadgets.particle.ParticleRain; import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.set.SetCandyCane; import mineplex.core.gadget.set.SetFrostLord; +import mineplex.core.gadget.set.SetTitan; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetSet; import mineplex.core.gadget.types.GadgetType; @@ -154,6 +156,8 @@ public class GadgetManager extends MiniPlugin private void createSets() { addSet(new SetFrostLord(this)); + addSet(new SetCandyCane(this)); + addSet(new SetTitan(this)); } private void CreateGadgets() diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java index d48320d58..aee21df5b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java @@ -12,7 +12,7 @@ public class HatGrinch extends HatGadget public HatGrinch(GadgetManager manager) { super(manager, "The Grinch", - UtilText.splitLineToArray(C.cGray + "Grinchtastic", LineFormat.LORE), + UtilText.splitLineToArray(C.cGray + "Great! Now where’s the Roast Beast?!", LineFormat.LORE), -3, "christmasgift"); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java new file mode 100644 index 000000000..ef898899a --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java @@ -0,0 +1,38 @@ +package mineplex.core.gadget.set; + +import org.bukkit.entity.Player; + +import mineplex.core.common.util.F; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; +import mineplex.core.gadget.gadgets.death.DeathCandyCane; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; +import mineplex.core.gadget.gadgets.particle.ParticleCandyCane; +import mineplex.core.gadget.types.GadgetSet; + +public class SetCandyCane extends GadgetSet +{ + + public SetCandyCane(GadgetManager manager) + { + super(manager, + manager.getGadget(ArrowTrailCandyCane.class), + manager.getGadget(DeathCandyCane.class), + manager.getGadget(DoubleJumpCandyCane.class), + manager.getGadget(ParticleCandyCane.class)); + } + + @Override + public void customEnable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Candy Cane"))); + } + + @Override + public void customDisable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Candy Cane"))); + + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java new file mode 100644 index 000000000..f2d6b86df --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java @@ -0,0 +1,38 @@ +package mineplex.core.gadget.set; + +import org.bukkit.entity.Player; + +import mineplex.core.common.util.F; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan; +import mineplex.core.gadget.gadgets.death.DeathTitan; +import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; +import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.types.GadgetSet; + +public class SetTitan extends GadgetSet +{ + + public SetTitan(GadgetManager manager) + { + super(manager, + manager.getGadget(ArrowTrailTitan.class), + manager.getGadget(DeathTitan.class), + manager.getGadget(DoubleJumpTitan.class), + manager.getGadget(ParticleTitan.class)); + } + + @Override + public void customEnable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Titan"))); + } + + @Override + public void customDisable(Player player) + { + player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Titan"))); + + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java index fae816a3f..e5b0667a1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java @@ -1,5 +1,6 @@ package mineplex.core.gadget.types; +import java.util.ArrayList; import java.util.HashSet; import mineplex.core.common.CurrencyType; @@ -26,6 +27,8 @@ public abstract class Gadget extends SalesPackageBase implements Listener protected HashSet _active = new HashSet(); + protected Gadget[] _set = null; + private String[] _alternativePackageNames; public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data) @@ -36,7 +39,7 @@ public abstract class Gadget extends SalesPackageBase implements Listener public Gadget(GadgetManager manager, GadgetType gadgetType, String name, String[] desc, int cost, Material mat, byte data, int quantity, String... alternativesalepackageNames) { super(name, mat, data, desc, cost, quantity); - + _gadgetType = gadgetType; KnownPackage = false; @@ -128,5 +131,13 @@ public abstract class Gadget extends SalesPackageBase implements Listener return false; } - + public void setSet(Gadget[] gadgets) + { + _set = gadgets; + } + + public Gadget[] getSet() + { + return _set; + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java index 94e7dde71..381c33660 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java @@ -25,6 +25,11 @@ public abstract class GadgetSet implements Listener Manager = manager; _gadgets = gadgets; + for (Gadget gadget : gadgets) + { + gadget.setSet(gadgets); + } + Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin()); } From 0cda29e135c9afcad3760f1195c22ff7a8466d87 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 20:08:36 +1100 Subject: [PATCH 25/51] improved cosmetic set implementation --- .../mineplex/core/cosmetic/ui/page/GadgetPage.java | 6 +++--- .../src/mineplex/core/gadget/set/SetCandyCane.java | 2 +- .../src/mineplex/core/gadget/set/SetFrostLord.java | 2 +- .../src/mineplex/core/gadget/set/SetTitan.java | 2 +- .../src/mineplex/core/gadget/types/Gadget.java | 8 ++++---- .../src/mineplex/core/gadget/types/GadgetSet.java | 13 +++++++++---- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 3746ce66d..76a6b8e52 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -135,11 +135,11 @@ public class GadgetPage extends ShopPageBase if (gadget.getSet() != null) { itemLore.add(C.cBlack); - itemLore.add(C.cGray + "Set Cosmetics;"); + itemLore.add(C.cGray + gadget.getSet().getName() + " Set Cosmetics;"); - for (Gadget cur : gadget.getSet()) + for (Gadget cur : gadget.getSet().getGadgets()) { - itemLore.add(" "+ (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName()); + itemLore.add(" ●"+ (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName()); } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java index ef898899a..377340a76 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java @@ -15,7 +15,7 @@ public class SetCandyCane extends GadgetSet public SetCandyCane(GadgetManager manager) { - super(manager, + super(manager, "Candy Cane", manager.getGadget(ArrowTrailCandyCane.class), manager.getGadget(DeathCandyCane.class), manager.getGadget(DoubleJumpCandyCane.class), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java index ce34dfc65..03882bcb4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java @@ -15,7 +15,7 @@ public class SetFrostLord extends GadgetSet public SetFrostLord(GadgetManager manager) { - super(manager, + super(manager, "Frost Lord", manager.getGadget(ArrowTrailFrostLord.class), manager.getGadget(DeathFrostLord.class), manager.getGadget(DoubleJumpFrostLord.class), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java index f2d6b86df..3005b348f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java @@ -15,7 +15,7 @@ public class SetTitan extends GadgetSet public SetTitan(GadgetManager manager) { - super(manager, + super(manager, "The Titans", manager.getGadget(ArrowTrailTitan.class), manager.getGadget(DeathTitan.class), manager.getGadget(DoubleJumpTitan.class), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java index e5b0667a1..6998e2a51 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java @@ -27,7 +27,7 @@ public abstract class Gadget extends SalesPackageBase implements Listener protected HashSet _active = new HashSet(); - protected Gadget[] _set = null; + protected GadgetSet _set = null; private String[] _alternativePackageNames; @@ -131,12 +131,12 @@ public abstract class Gadget extends SalesPackageBase implements Listener return false; } - public void setSet(Gadget[] gadgets) + public void setSet(GadgetSet set) { - _set = gadgets; + _set = set; } - public Gadget[] getSet() + public GadgetSet getSet() { return _set; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java index 381c33660..84632846e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java @@ -13,6 +13,7 @@ import mineplex.core.gadget.event.GadgetDisableEvent; public abstract class GadgetSet implements Listener { + private String _name; private Gadget[] _gadgets; @@ -20,15 +21,14 @@ public abstract class GadgetSet implements Listener HashSet _active = new HashSet<>(); - public GadgetSet(GadgetManager manager, Gadget... gadgets) + public GadgetSet(GadgetManager manager, String name, Gadget... gadgets) { Manager = manager; _gadgets = gadgets; + _name = name; for (Gadget gadget : gadgets) - { - gadget.setSet(gadgets); - } + gadget.setSet(this); Bukkit.getPluginManager().registerEvents(this, Manager.getPlugin()); } @@ -92,6 +92,11 @@ public abstract class GadgetSet implements Listener } return false; } + + public String getName() { + // TODO Auto-generated method stub + return null; + } From f717a5f8ccaba9f55dc5f6138c18dce36b1f4e91 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 20:30:41 +1100 Subject: [PATCH 26/51] more set stuff --- .../core/cosmetic/ui/page/GadgetPage.java | 32 +++++++++-------- .../gadgets/particle/ParticleFrostLord.java | 4 +-- .../gadgets/particle/ParticleTitan.java | 4 +++ .../core/gadget/set/SetCandyCane.java | 16 +-------- .../core/gadget/set/SetFrostLord.java | 16 +-------- .../mineplex/core/gadget/set/SetTitan.java | 16 +-------- .../mineplex/core/gadget/types/GadgetSet.java | 36 ++++++++++++++----- 7 files changed, 54 insertions(+), 70 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 76a6b8e52..6e0e39eb6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -81,6 +81,23 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cBlack); itemLore.addAll(Arrays.asList(gadget.GetDescription())); + if (gadget.getSet() != null) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGray + gadget.getSet().getName() + " Set;"); + + //Elements + for (Gadget cur : gadget.getSet().getGadgets()) + itemLore.add(" "+ (cur.ownsGadget(getPlayer()) ? C.cDGreen + '▪' : C.cDRed + '▪' ) + (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName()); + + itemLore.add(C.cBlack); + + //Bonus + itemLore.add(C.cGray + gadget.getSet().getName() + " Set Bonus;"); + for (String bonus : gadget.getSet().getBonus()) + itemLore.add(" " + (gadget.getSet().isActive(getPlayer()) ? C.cGreen : C.cGray) + bonus); + } + if (!gadget.ownsGadget(getPlayer())) { if (gadget.GetCost(CurrencyType.Coins) == -1) @@ -130,20 +147,7 @@ public class GadgetPage extends ShopPageBase itemLore.add(C.cRed + "Unlocked with Titan Rank"); } } - else - { - if (gadget.getSet() != null) - { - itemLore.add(C.cBlack); - itemLore.add(C.cGray + gadget.getSet().getName() + " Set Cosmetics;"); - - for (Gadget cur : gadget.getSet().getGadgets()) - { - itemLore.add(" ●"+ (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName()); - } - } - } - + if (gadget instanceof ItemGadget) { itemLore.add(C.cBlack); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java index faa25065f..035615c59 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleFrostLord.java @@ -57,8 +57,8 @@ public class ParticleFrostLord extends ParticleGadget int amount = 4; - GadgetSet set = Manager.getGadgetSet(SetFrostLord.class); - if(set.isActive(player)) amount = 6; + if(getSet() != null && getSet().isActive(player)) + amount = 6; double ang = Math.PI*2/amount; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java index d8270ec62..b751709ac 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleTitan.java @@ -48,6 +48,10 @@ public class ParticleTitan extends ParticleGadget continue; double total = 3; + + if(getSet() != null && getSet().isActive(player)) + total = 4; + double step = (1/total)*Math.PI*2; double offset1 = (step/20)*_tick%20; double offset2 = (step/31)*_tick%31; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java index 377340a76..8a1acaf71 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetCandyCane.java @@ -15,24 +15,10 @@ public class SetCandyCane extends GadgetSet public SetCandyCane(GadgetManager manager) { - super(manager, "Candy Cane", + super(manager, "Candy Cane", "Coming Soon...", manager.getGadget(ArrowTrailCandyCane.class), manager.getGadget(DeathCandyCane.class), manager.getGadget(DoubleJumpCandyCane.class), manager.getGadget(ParticleCandyCane.class)); } - - @Override - public void customEnable(Player player) - { - player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Candy Cane"))); - } - - @Override - public void customDisable(Player player) - { - player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Candy Cane"))); - - } - } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java index 03882bcb4..fec0b8950 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetFrostLord.java @@ -15,24 +15,10 @@ public class SetFrostLord extends GadgetSet public SetFrostLord(GadgetManager manager) { - super(manager, "Frost Lord", + super(manager, "Frost Lord", "Improved Wind of the Frost Lord", manager.getGadget(ArrowTrailFrostLord.class), manager.getGadget(DeathFrostLord.class), manager.getGadget(DoubleJumpFrostLord.class), manager.getGadget(ParticleFrostLord.class)); } - - @Override - public void customEnable(Player player) - { - player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Frost Lord"))); - } - - @Override - public void customDisable(Player player) - { - player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Frost Lord"))); - - } - } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java index 3005b348f..bc18e252a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java @@ -15,24 +15,10 @@ public class SetTitan extends GadgetSet public SetTitan(GadgetManager manager) { - super(manager, "The Titans", + super(manager, "The Titans", "Improved Flame of the Frost Lord", manager.getGadget(ArrowTrailTitan.class), manager.getGadget(DeathTitan.class), manager.getGadget(DoubleJumpTitan.class), manager.getGadget(ParticleTitan.class)); } - - @Override - public void customEnable(Player player) - { - player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Titan"))); - } - - @Override - public void customDisable(Player player) - { - player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Titan"))); - - } - } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java index 84632846e..a2f6df54e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java @@ -7,6 +7,10 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.event.GadgetDisableEvent; @@ -14,6 +18,7 @@ import mineplex.core.gadget.event.GadgetDisableEvent; public abstract class GadgetSet implements Listener { private String _name; + private String[] _bonus; private Gadget[] _gadgets; @@ -21,11 +26,13 @@ public abstract class GadgetSet implements Listener HashSet _active = new HashSet<>(); - public GadgetSet(GadgetManager manager, String name, Gadget... gadgets) + public GadgetSet(GadgetManager manager, String name, String bonus, Gadget... gadgets) { Manager = manager; _gadgets = gadgets; + _name = name; + _bonus = UtilText.splitLineToArray(bonus, LineFormat.LORE); for (Gadget gadget : gadgets) gadget.setSet(this); @@ -44,7 +51,8 @@ public abstract class GadgetSet implements Listener if(enable && g.equals(gadget)) continue; _active.remove(player); - if(wasActive) customDisable(player); + if(wasActive) + customDisable(player); return; } } @@ -72,10 +80,16 @@ public abstract class GadgetSet implements Listener return _active.contains(player); } - public abstract void customEnable(Player player); - - - public abstract void customDisable(Player player); + public void customEnable(Player player) + { + player.sendMessage(F.main("Gadget", "Set Enabled: " + F.elem(C.cGreen + getName()))); + } + + public void customDisable(Player player) + { + player.sendMessage(F.main("Gadget", "Set Disabled: " + F.elem(C.cRed + getName()))); + + } public Gadget[] getGadgets() { @@ -93,11 +107,15 @@ public abstract class GadgetSet implements Listener return false; } - public String getName() { - // TODO Auto-generated method stub - return null; + public String getName() + { + return _name; } + public String[] getBonus() + { + return _bonus; + } } From 7fc08f34a7c3909cdf1272dffbe7bd9fd4665c41 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 20:34:01 +1100 Subject: [PATCH 27/51] fixed typo --- .../Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java index bc18e252a..f2012131b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetTitan.java @@ -15,7 +15,7 @@ public class SetTitan extends GadgetSet public SetTitan(GadgetManager manager) { - super(manager, "The Titans", "Improved Flame of the Frost Lord", + super(manager, "The Titans", "Improved Flame of the Titans", manager.getGadget(ArrowTrailTitan.class), manager.getGadget(DeathTitan.class), manager.getGadget(DoubleJumpTitan.class), From d7f39bdfd8919b8456d64fd88c4992e9a730c6bd Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 20:59:55 +1100 Subject: [PATCH 28/51] costume sets --- .../core/cosmetic/ui/page/CostumePage.java | 20 ++-- .../mineplex/core/gadget/GadgetManager.java | 91 +++++-------------- .../gadget/gadgets/item/ItemDuelingSword.java | 2 +- .../gadget/gadgets/item/ItemPaintbrush.java | 2 +- .../gadgets/outfit/OutfitRaveSuitBoots.java | 15 +++ .../outfit/OutfitRaveSuitChestplate.java | 15 +++ .../gadgets/outfit/OutfitRaveSuitHelmet.java | 15 +++ .../outfit/OutfitRaveSuitLeggings.java | 15 +++ .../gadgets/outfit/OutfitSpaceSuitBoots.java | 15 +++ .../outfit/OutfitSpaceSuitChestplate.java | 15 +++ .../gadgets/outfit/OutfitSpaceSuitHelmet.java | 15 +++ .../outfit/OutfitSpaceSuitLeggings.java | 15 +++ .../gadget/gadgets/outfit/OutfitTeam.java | 2 +- .../mineplex/core/gadget/set/SetRaveSuit.java | 17 ++++ .../core/gadget/set/SetSpaceSuit.java | 17 ++++ .../core/gadget/types/ArrowEffectGadget.java | 2 +- .../core/gadget/types/DeathEffectGadget.java | 2 +- .../gadget/types/DoubleJumpEffectGadget.java | 2 +- .../mineplex/core/gadget/types/GadgetSet.java | 5 +- .../mineplex/core/gadget/types/HatGadget.java | 2 +- .../core/gadget/types/ItemGadget.java | 2 +- .../core/gadget/types/MorphGadget.java | 2 +- .../core/gadget/types/OutfitGadget.java | 2 +- .../core/gadget/types/ParticleGadget.java | 2 +- .../hub/commands/DisguiseCommand.java | 2 +- .../game/arcade/command/DisguiseCommand.java | 2 +- 26 files changed, 206 insertions(+), 90 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitBoots.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitChestplate.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitHelmet.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitLeggings.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java index 8e32e2707..bed2836d0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java @@ -1,6 +1,7 @@ package mineplex.core.cosmetic.ui.page; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import org.bukkit.Bukkit; @@ -10,10 +11,13 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; import mineplex.core.account.CoreClientManager; +import mineplex.core.common.CurrencyType; import mineplex.core.common.util.C; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.donation.DonationManager; +import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit; +import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.gadget.types.ItemGadget; @@ -37,19 +41,19 @@ public class CostumePage extends GadgetPage { int slot; - List costumeClasses = new ArrayList(); - for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Costume)) { + if (gadget.GetCost(CurrencyType.Coins) == -1) + continue; + OutfitGadget outfitGadget = ((OutfitGadget) gadget); - Class clazz = gadget.getClass(); - if (!costumeClasses.contains(clazz)) - { - costumeClasses.add(clazz); - } + int offset = 0; + + if (gadget instanceof OutfitRaveSuit) offset = 0; + else if (gadget instanceof OutfitSpaceSuit) offset = 1; - slot = (costumeClasses.indexOf(clazz) * 2) + 3 + 18; + slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Chest) slot += 9; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index c817ad7c5..8439e08cb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -32,66 +32,18 @@ import mineplex.core.disguise.DisguiseManager; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.gadget.event.GadgetEnableEvent; -import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane; -import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord; -import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan; -import mineplex.core.gadget.gadgets.death.DeathCandyCane; -import mineplex.core.gadget.gadgets.death.DeathFrostLord; -import mineplex.core.gadget.gadgets.death.DeathTitan; -import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane; -import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord; -import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan; -import mineplex.core.gadget.gadgets.hat.HatCoal; -import mineplex.core.gadget.gadgets.hat.HatPresent; -import mineplex.core.gadget.gadgets.hat.HatSanta; -import mineplex.core.gadget.gadgets.hat.HatSnowman; -import mineplex.core.gadget.gadgets.item.ItemBatGun; -import mineplex.core.gadget.gadgets.item.ItemCoal; -import mineplex.core.gadget.gadgets.item.ItemCoinBomb; -import mineplex.core.gadget.gadgets.item.ItemDuelingSword; -import mineplex.core.gadget.gadgets.item.ItemEtherealPearl; -import mineplex.core.gadget.gadgets.item.ItemFirework; -import mineplex.core.gadget.gadgets.item.ItemFleshHook; -import mineplex.core.gadget.gadgets.item.ItemFreezeCannon; -import mineplex.core.gadget.gadgets.item.ItemMelonLauncher; -import mineplex.core.gadget.gadgets.item.ItemPaintballGun; -import mineplex.core.gadget.gadgets.item.ItemPaintbrush; -import mineplex.core.gadget.gadgets.item.ItemPartyPopper; -import mineplex.core.gadget.gadgets.item.ItemSnowball; -import mineplex.core.gadget.gadgets.item.ItemTNT; -import mineplex.core.gadget.gadgets.morph.MorphBat; -import mineplex.core.gadget.gadgets.morph.MorphBlaze; -import mineplex.core.gadget.gadgets.morph.MorphBlock; -import mineplex.core.gadget.gadgets.morph.MorphBunny; -import mineplex.core.gadget.gadgets.morph.MorphChicken; -import mineplex.core.gadget.gadgets.morph.MorphCow; -import mineplex.core.gadget.gadgets.morph.MorphCreeper; -import mineplex.core.gadget.gadgets.morph.MorphEnderman; -import mineplex.core.gadget.gadgets.morph.MorphPig; -import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing; -import mineplex.core.gadget.gadgets.morph.MorphSlime; -import mineplex.core.gadget.gadgets.morph.MorphSnowman; -import mineplex.core.gadget.gadgets.morph.MorphTitan; -import mineplex.core.gadget.gadgets.morph.MorphVillager; -import mineplex.core.gadget.gadgets.morph.MorphWither; -import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit; -import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit; -import mineplex.core.gadget.gadgets.outfit.OutfitTeam; -import mineplex.core.gadget.gadgets.particle.ParticleCandyCane; -import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; -import mineplex.core.gadget.gadgets.particle.ParticleEnchant; -import mineplex.core.gadget.gadgets.particle.ParticleFairy; -import mineplex.core.gadget.gadgets.particle.ParticleFireRings; -import mineplex.core.gadget.gadgets.particle.ParticleFoot; -import mineplex.core.gadget.gadgets.particle.ParticleFrostLord; -import mineplex.core.gadget.gadgets.particle.ParticleGreen; -import mineplex.core.gadget.gadgets.particle.ParticleHeart; -import mineplex.core.gadget.gadgets.particle.ParticleHelix; -import mineplex.core.gadget.gadgets.particle.ParticleLegend; -import mineplex.core.gadget.gadgets.particle.ParticleRain; -import mineplex.core.gadget.gadgets.particle.ParticleTitan; +import mineplex.core.gadget.gadgets.arrowtrail.*; +import mineplex.core.gadget.gadgets.death.*; +import mineplex.core.gadget.gadgets.doublejump.*; +import mineplex.core.gadget.gadgets.hat.*; +import mineplex.core.gadget.gadgets.item.*; +import mineplex.core.gadget.gadgets.morph.*; +import mineplex.core.gadget.gadgets.outfit.*; +import mineplex.core.gadget.gadgets.particle.*; import mineplex.core.gadget.set.SetCandyCane; import mineplex.core.gadget.set.SetFrostLord; +import mineplex.core.gadget.set.SetRaveSuit; +import mineplex.core.gadget.set.SetSpaceSuit; import mineplex.core.gadget.set.SetTitan; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetSet; @@ -155,9 +107,14 @@ public class GadgetManager extends MiniPlugin private void createSets() { + //Particles addSet(new SetFrostLord(this)); addSet(new SetCandyCane(this)); addSet(new SetTitan(this)); + + //Costumes + addSet(new SetRaveSuit(this)); + addSet(new SetSpaceSuit(this)); } private void CreateGadgets() @@ -181,15 +138,15 @@ public class GadgetManager extends MiniPlugin addGadget(new ItemSnowball(this)); // Costume - addGadget(new OutfitRaveSuit(this, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0)); - addGadget(new OutfitRaveSuit(this, "Rave Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0)); - addGadget(new OutfitRaveSuit(this, "Rave Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0)); - addGadget(new OutfitRaveSuit(this, "Rave Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0)); + addGadget(new OutfitRaveSuitHelmet(this)); + addGadget(new OutfitRaveSuitChestplate(this)); + addGadget(new OutfitRaveSuitLeggings(this)); + addGadget(new OutfitRaveSuitBoots(this)); - addGadget(new OutfitSpaceSuit(this, "Space Helmet", -2, ArmorSlot.Helmet, Material.GLASS, (byte)0)); - addGadget(new OutfitSpaceSuit(this, "Space Jacket", -2, ArmorSlot.Chest, Material.GOLD_CHESTPLATE, (byte)0)); - addGadget(new OutfitSpaceSuit(this, "Space Pants", -2, ArmorSlot.Legs, Material.GOLD_LEGGINGS, (byte)0)); - addGadget(new OutfitSpaceSuit(this, "Space Boots", -2, ArmorSlot.Boots, Material.GOLD_BOOTS, (byte)0)); + addGadget(new OutfitSpaceSuitHelmet(this)); + addGadget(new OutfitSpaceSuitChestplate(this)); + addGadget(new OutfitSpaceSuitLeggings(this)); + addGadget(new OutfitSpaceSuitBoots(this)); addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0)); addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0)); @@ -351,7 +308,7 @@ public class GadgetManager extends MiniPlugin } } - public void removeGadetType(Player player, GadgetType type) + public void removeGadgetType(Player player, GadgetType type) { List gadgets = _gadgets.get(type); if(gadgets == null) return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java index 99a7d217f..c8ced1f05 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemDuelingSword.java @@ -28,7 +28,7 @@ public class ItemDuelingSword extends ItemGadget @Override public void ApplyItem(Player player, boolean inform) { - Manager.removeGadetType(player, GadgetType.Item); + Manager.removeGadgetType(player, GadgetType.Item); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java index 9fa4d783b..2815a9b5e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java @@ -55,7 +55,7 @@ public class ItemPaintbrush extends ItemGadget @Override public void ApplyItem(Player player, boolean inform) { - Manager.removeGadetType(player, GadgetType.Item); + Manager.removeGadgetType(player, GadgetType.Item); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitBoots.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitBoots.java new file mode 100644 index 000000000..b74eda769 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitBoots.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitRaveSuitBoots extends OutfitRaveSuit +{ + + public OutfitRaveSuitBoots(GadgetManager manager) + { + super(manager, "Rave Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitChestplate.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitChestplate.java new file mode 100644 index 000000000..df3b5577e --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitChestplate.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitRaveSuitChestplate extends OutfitRaveSuit +{ + + public OutfitRaveSuitChestplate(GadgetManager manager) + { + super(manager, "Rave Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitHelmet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitHelmet.java new file mode 100644 index 000000000..122ea157d --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitHelmet.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitRaveSuitHelmet extends OutfitRaveSuit +{ + + public OutfitRaveSuitHelmet(GadgetManager manager) + { + super(manager, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitLeggings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitLeggings.java new file mode 100644 index 000000000..b4b14df9d --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuitLeggings.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitRaveSuitLeggings extends OutfitRaveSuit +{ + + public OutfitRaveSuitLeggings(GadgetManager manager) + { + super(manager, "Rave Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java new file mode 100644 index 000000000..58a02b36b --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitSpaceSuitBoots extends OutfitRaveSuit +{ + + public OutfitSpaceSuitBoots(GadgetManager manager) + { + super(manager, "Space Boots", -2, ArmorSlot.Boots, Material.GOLD_BOOTS, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java new file mode 100644 index 000000000..5a6d3f807 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitSpaceSuitChestplate extends OutfitRaveSuit +{ + + public OutfitSpaceSuitChestplate(GadgetManager manager) + { + super(manager, "Space Jacket", -2, ArmorSlot.Chest, Material.GOLD_CHESTPLATE, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java new file mode 100644 index 000000000..09fb5ddbb --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitSpaceSuitHelmet extends OutfitRaveSuit +{ + + public OutfitSpaceSuitHelmet(GadgetManager manager) + { + super(manager, "Space Helmet", -2, ArmorSlot.Helmet, Material.GLASS, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java new file mode 100644 index 000000000..650aea844 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java @@ -0,0 +1,15 @@ +package mineplex.core.gadget.gadgets.outfit; + +import mineplex.core.gadget.GadgetManager; + +import org.bukkit.Material; + +public class OutfitSpaceSuitLeggings extends OutfitRaveSuit +{ + + public OutfitSpaceSuitLeggings(GadgetManager manager) + { + super(manager, "Space Pants", -2, ArmorSlot.Legs, Material.GOLD_LEGGINGS, (byte)0); + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java index 6b598c419..8abec4a35 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitTeam.java @@ -56,7 +56,7 @@ public class OutfitTeam extends OutfitGadget @Override public void ApplyArmor(Player player) { - Manager.removeGadetType(player, GadgetType.Morph); + Manager.removeGadgetType(player, GadgetType.Morph); Manager.RemoveOutfit(player, _slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java new file mode 100644 index 000000000..8dd0f874c --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java @@ -0,0 +1,17 @@ +package mineplex.core.gadget.set; + +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.outfit.*; +import mineplex.core.gadget.types.GadgetSet; + +public class SetRaveSuit extends GadgetSet +{ + public SetRaveSuit(GadgetManager manager) + { + super(manager, "Rave Suit", "Coming Soon...", + manager.getGadget(OutfitRaveSuitHelmet.class), + manager.getGadget(OutfitRaveSuitChestplate.class), + manager.getGadget(OutfitRaveSuitLeggings.class), + manager.getGadget(OutfitRaveSuitBoots.class)); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java new file mode 100644 index 000000000..27f7390e7 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java @@ -0,0 +1,17 @@ +package mineplex.core.gadget.set; + +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.outfit.*; +import mineplex.core.gadget.types.GadgetSet; + +public class SetSpaceSuit extends GadgetSet +{ + public SetSpaceSuit(GadgetManager manager) + { + super(manager, "Space Suit", "Coming Soon...", + manager.getGadget(OutfitSpaceSuitHelmet.class), + manager.getGadget(OutfitSpaceSuitChestplate.class), + manager.getGadget(OutfitSpaceSuitLeggings.class), + manager.getGadget(OutfitSpaceSuitBoots.class)); + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java index 3513506a9..a32e05163 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ArrowEffectGadget.java @@ -28,7 +28,7 @@ public abstract class ArrowEffectGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.removeGadetType(player, GadgetType.ArrowTrail); + Manager.removeGadgetType(player, GadgetType.ArrowTrail); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java index 4e04cb807..5e337586c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DeathEffectGadget.java @@ -17,7 +17,7 @@ public abstract class DeathEffectGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.removeGadetType(player, GadgetType.Death); + Manager.removeGadgetType(player, GadgetType.Death); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java index 59575b97f..f59c0ed50 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/DoubleJumpEffectGadget.java @@ -19,7 +19,7 @@ public abstract class DoubleJumpEffectGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.removeGadetType(player, GadgetType.DoubleJump); + Manager.removeGadgetType(player, GadgetType.DoubleJump); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java index a2f6df54e..234bbc2dd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/GadgetSet.java @@ -5,6 +5,7 @@ import java.util.HashSet; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import mineplex.core.common.util.C; @@ -63,13 +64,13 @@ public abstract class GadgetSet implements Listener } } - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onActivate(GadgetEnableEvent event) { checkPlayer(event.getPlayer(), event.getGadget(), true); } - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) public void onDeativate(GadgetDisableEvent event) { checkPlayer(event.getPlayer(), event.getGadget(), false); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java index e7ad0ea37..91d5c2da7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java @@ -33,7 +33,7 @@ public abstract class HatGadget extends OutfitGadget public void ApplyArmor(Player player) { - Manager.removeGadetType(player, GadgetType.Morph); + Manager.removeGadgetType(player, GadgetType.Morph); Manager.RemoveOutfit(player, _slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java index 212964745..639ccea9f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java @@ -64,7 +64,7 @@ public abstract class ItemGadget extends Gadget public void ApplyItem(Player player, boolean inform) { - Manager.removeGadetType(player, GadgetType.Item); + Manager.removeGadgetType(player, GadgetType.Item); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java index c90606af7..96c19d0ad 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/MorphGadget.java @@ -19,7 +19,7 @@ public abstract class MorphGadget extends Gadget public void ApplyArmor(Player player) { - Manager.removeGadetType(player, GadgetType.Morph); + Manager.removeGadgetType(player, GadgetType.Morph); _active.add(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java index 83c54ac96..1d778742a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java @@ -34,7 +34,7 @@ public abstract class OutfitGadget extends Gadget public void ApplyArmor(Player player) { - Manager.removeGadetType(player, GadgetType.Morph); + Manager.removeGadgetType(player, GadgetType.Morph); Manager.RemoveOutfit(player, _slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java index 24444a965..bc807eb48 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java @@ -17,7 +17,7 @@ public abstract class ParticleGadget extends Gadget @Override public void EnableCustom(Player player) { - Manager.removeGadetType(player, GadgetType.Particle); + Manager.removeGadgetType(player, GadgetType.Particle); _active.add(player); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java index 16b832c76..bb078b3bb 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/DisguiseCommand.java @@ -178,7 +178,7 @@ public class DisguiseCommand extends CommandBase implements Listener changeName(caller, args[0]); - Plugin.GetGadget().removeGadetType(caller, GadgetType.Item); + Plugin.GetGadget().removeGadgetType(caller, GadgetType.Item); UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]); } catch(Exception e) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java index f10a8db0d..7111ae370 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/DisguiseCommand.java @@ -169,7 +169,7 @@ public class DisguiseCommand extends CommandBase implements Liste changeName(caller, args[0], true); - Plugin.getCosmeticManager().getGadgetManager().removeGadetType(caller, GadgetType.Item); + Plugin.getCosmeticManager().getGadgetManager().removeGadgetType(caller, GadgetType.Item); Bukkit.broadcastMessage(ChatColor.DARK_GRAY + "Quit> " + ChatColor.GRAY + _disguisedPlayersNames.get(caller)); UtilPlayer.message(caller, C.cGreen + C.Bold + "Disguise Active: " + ChatColor.RESET + args[0]); From 40c2fdc3fcf8ea3e39fec317bc983f00f2e1a3c8 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 21:11:35 +1100 Subject: [PATCH 29/51] fixed suits --- .../src/mineplex/core/cosmetic/ui/page/CostumePage.java | 3 ++- .../mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java | 6 +++++- .../core/gadget/gadgets/outfit/OutfitSpaceSuit.java | 6 +++++- .../core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java | 2 +- .../gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java | 2 +- .../core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java | 2 +- .../core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java index bed2836d0..47e4ea4ac 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/CostumePage.java @@ -52,7 +52,8 @@ public class CostumePage extends GadgetPage if (gadget instanceof OutfitRaveSuit) offset = 0; else if (gadget instanceof OutfitSpaceSuit) offset = 1; - + else offset = 2; + slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Chest) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java index cd43be616..12d8f46ae 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java @@ -12,8 +12,10 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.LeatherArmorMeta; +import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.OutfitGadget; import mineplex.core.updater.UpdateType; @@ -27,7 +29,9 @@ public class OutfitRaveSuit extends OutfitGadget public OutfitRaveSuit(GadgetManager manager, String name, int cost, ArmorSlot slot, Material mat, byte data) { - super(manager, name, new String[] {ChatColor.RESET + "Wear the complete set for",ChatColor.RESET + "awesome bonus effects!", ChatColor.RESET + "Bonus coming soon..."}, cost, slot, mat, data); + super(manager, name, + UtilText.splitLineToArray("There's nothing more suitable for celebration than this high tech flashing outfit!", LineFormat.LORE), + cost, slot, mat, data); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java index c634500b2..7f0d06ccd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java @@ -4,6 +4,8 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.OutfitGadget; @@ -12,7 +14,9 @@ public class OutfitSpaceSuit extends OutfitGadget public OutfitSpaceSuit(GadgetManager manager, String name, int cost, ArmorSlot slot, Material mat, byte data) { - super(manager, name, new String[] {ChatColor.RESET + "Wear the complete set for",ChatColor.RESET + "awesome bonus effects!", ChatColor.RESET + "Bonus coming soon..."}, cost, slot, mat, data); + super(manager, name, + UtilText.splitLineToArray("Designed specifically for combat in space for a sport known as \'Gravity\'", LineFormat.LORE), + cost, slot, mat, data); } @Override diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java index 58a02b36b..46b242283 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitBoots.java @@ -4,7 +4,7 @@ import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; -public class OutfitSpaceSuitBoots extends OutfitRaveSuit +public class OutfitSpaceSuitBoots extends OutfitSpaceSuit { public OutfitSpaceSuitBoots(GadgetManager manager) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java index 5a6d3f807..f2da731f0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitChestplate.java @@ -4,7 +4,7 @@ import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; -public class OutfitSpaceSuitChestplate extends OutfitRaveSuit +public class OutfitSpaceSuitChestplate extends OutfitSpaceSuit { public OutfitSpaceSuitChestplate(GadgetManager manager) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java index 09fb5ddbb..2d5dabb70 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitHelmet.java @@ -4,7 +4,7 @@ import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; -public class OutfitSpaceSuitHelmet extends OutfitRaveSuit +public class OutfitSpaceSuitHelmet extends OutfitSpaceSuit { public OutfitSpaceSuitHelmet(GadgetManager manager) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java index 650aea844..3f29bced9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuitLeggings.java @@ -4,7 +4,7 @@ import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; -public class OutfitSpaceSuitLeggings extends OutfitRaveSuit +public class OutfitSpaceSuitLeggings extends OutfitSpaceSuit { public OutfitSpaceSuitLeggings(GadgetManager manager) From e01a5369fd627813b7d115f3027991ba47294dc8 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 21:53:39 +1100 Subject: [PATCH 30/51] set bonuses item gadget gui update --- .../src/mineplex/core/antihack/types/Fly.java | 6 +++++ .../core/cosmetic/ui/page/GadgetPage.java | 24 +++++++++++++++---- .../gadget/gadgets/outfit/OutfitRaveSuit.java | 19 ++++++++++++++- .../gadgets/outfit/OutfitSpaceSuit.java | 24 ++++++++++++++++++- .../mineplex/core/gadget/set/SetRaveSuit.java | 2 +- .../core/gadget/set/SetSpaceSuit.java | 2 +- 6 files changed, 68 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java index fd7b557af..0941d4a2a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java @@ -16,6 +16,8 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; public class Fly extends MiniPlugin implements Detector { @@ -128,6 +130,10 @@ public class Fly extends MiniPlugin implements Detector } } + for (PotionEffect effect : player.getActivePotionEffects()) + if (effect.getType() == PotionEffectType.JUMP || effect.getType().equals(PotionEffectType.JUMP)) + nearBlocks = true; + if (nearBlocks) { count = 0; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 6e0e39eb6..e15d9db7b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -150,11 +150,25 @@ public class GadgetPage extends ShopPageBase if (gadget instanceof ItemGadget) { + ItemGadget itemGadget = (ItemGadget)gadget; + + if (itemGadget.getAmmo().GetCost(CurrencyType.Coins) > 0) + { + itemLore.add(C.cBlack); + itemLore.add(C.cWhite + ((ItemGadget)gadget).getAmmo().GetDisplayName() + " for " + C.cYellow + ((ItemGadget)gadget).getAmmo().GetCost(CurrencyType.Coins) + " Coins"); + + if (getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= itemGadget.getAmmo().GetCost(CurrencyType.Coins)) + { + itemLore.add(C.cGreen + "Right-Click To Purchase"); + } + else + { + itemLore.add(C.cRed + "Not Enough Treasure Shards."); + } + } + itemLore.add(C.cBlack); - itemLore.add(C.cGreen + "Right-Click To Purchase:"); - itemLore.add(C.cWhite + ((ItemGadget)gadget).getAmmo().GetDisplayName() + " for " + C.cYellow + ((ItemGadget)gadget).getAmmo().GetCost(CurrencyType.Coins) + " Coins"); - itemLore.add(C.cBlack); - itemLore.add(C.cWhite + "Your Ammo : " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName())); + itemLore.add(C.cWhite + "You Have: " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName())); } if (gadget.ownsGadget(getPlayer())) @@ -196,7 +210,7 @@ public class GadgetPage extends ShopPageBase setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); } - else + else { setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java index 12d8f46ae..7ff4e8986 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitRaveSuit.java @@ -11,7 +11,10 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.LeatherArmorMeta; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilServer; @@ -30,7 +33,7 @@ public class OutfitRaveSuit extends OutfitGadget int cost, ArmorSlot slot, Material mat, byte data) { super(manager, name, - UtilText.splitLineToArray("There's nothing more suitable for celebration than this high tech flashing outfit!", LineFormat.LORE), + UtilText.splitLineToArray(C.cWhite + "There's nothing more suitable for celebration than this high tech flashing outfit!", LineFormat.LORE), cost, slot, mat, data); } @@ -159,4 +162,18 @@ public class OutfitRaveSuit extends OutfitGadget { _colorPhase.remove(event.getPlayer().getName()); } + + @EventHandler + public void setBonus(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + if (GetSlot() != ArmorSlot.Helmet) + return; + + for (Player player : UtilServer.getPlayers()) + if (getSet() != null && getSet().isActive(player)) + player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 39, 4, true, false), true); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java index 7f0d06ccd..16cb9a226 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitSpaceSuit.java @@ -3,11 +3,19 @@ package mineplex.core.gadget.gadgets.outfit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.types.OutfitGadget; +import mineplex.core.gadget.types.OutfitGadget.ArmorSlot; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; public class OutfitSpaceSuit extends OutfitGadget { @@ -15,7 +23,7 @@ public class OutfitSpaceSuit extends OutfitGadget int cost, ArmorSlot slot, Material mat, byte data) { super(manager, name, - UtilText.splitLineToArray("Designed specifically for combat in space for a sport known as \'Gravity\'", LineFormat.LORE), + UtilText.splitLineToArray(C.cWhite + "Designed specifically for combat in deep space for a sport known as \'Gravity\'", LineFormat.LORE), cost, slot, mat, data); } @@ -30,4 +38,18 @@ public class OutfitSpaceSuit extends OutfitGadget { RemoveArmor(player); } + + @EventHandler + public void setBonus(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + if (GetSlot() != ArmorSlot.Helmet) + return; + + for (Player player : UtilServer.getPlayers()) + if (getSet() != null && getSet().isActive(player)) + player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 39, 7, true, false), true); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java index 8dd0f874c..ea01fa10a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetRaveSuit.java @@ -8,7 +8,7 @@ public class SetRaveSuit extends GadgetSet { public SetRaveSuit(GadgetManager manager) { - super(manager, "Rave Suit", "Coming Soon...", + super(manager, "Rave Suit", "Hyper Speed", manager.getGadget(OutfitRaveSuitHelmet.class), manager.getGadget(OutfitRaveSuitChestplate.class), manager.getGadget(OutfitRaveSuitLeggings.class), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java index 27f7390e7..492b7a11f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetSpaceSuit.java @@ -8,7 +8,7 @@ public class SetSpaceSuit extends GadgetSet { public SetSpaceSuit(GadgetManager manager) { - super(manager, "Space Suit", "Coming Soon...", + super(manager, "Space Suit", "Low Gravity", manager.getGadget(OutfitSpaceSuitHelmet.class), manager.getGadget(OutfitSpaceSuitChestplate.class), manager.getGadget(OutfitSpaceSuitLeggings.class), From 7c432461c93379b62cebf603db3629574b1ce291 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 22:25:14 +1100 Subject: [PATCH 31/51] changed coal item rewards to 3 tier :) --- .../core/cosmetic/ui/page/GadgetPage.java | 31 +++- .../core/gadget/gadgets/hat/HatCoal.java | 4 +- .../core/gadget/gadgets/item/ItemCoal.java | 159 +++++++++++++----- .../core/gadget/types/ItemGadget.java | 7 +- .../core/pet/types/PetCoalApparition.java | 2 +- 5 files changed, 158 insertions(+), 45 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index e15d9db7b..8b89c1c83 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -148,10 +148,15 @@ public class GadgetPage extends ShopPageBase } } + //Special case for item gadgets! if (gadget instanceof ItemGadget) { ItemGadget itemGadget = (ItemGadget)gadget; + itemLore.add(C.cBlack); + itemLore.add(C.cWhite + "You Have: " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName())); + + boolean canAffordAmmo = true; if (itemGadget.getAmmo().GetCost(CurrencyType.Coins) > 0) { itemLore.add(C.cBlack); @@ -164,13 +169,26 @@ public class GadgetPage extends ShopPageBase else { itemLore.add(C.cRed + "Not Enough Treasure Shards."); + canAffordAmmo = false; } } - itemLore.add(C.cBlack); - itemLore.add(C.cWhite + "You Have: " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName())); + if (itemGadget.hasAmmo(getPlayer())) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Left-Click to Enable"); + + addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateGadgetButton(gadget, this)); + } + else + { + addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new ActivateGadgetButton(gadget, this)); + } + + return; } + //Standard if (gadget.ownsGadget(getPlayer())) { if (gadget.GetActive().contains(getPlayer())) @@ -219,6 +237,15 @@ public class GadgetPage extends ShopPageBase public void purchaseGadget(final Player player, final Gadget gadget) { + //Dont allow purchase! + if (gadget instanceof ItemGadget) + { + ItemGadget itemGadget = (ItemGadget)gadget; + + if (itemGadget.getAmmo().GetCost(CurrencyType.Coins) < 0) + return; + } + if(getClientManager().Get(player).isDisguised()) { UtilPlayer.message(player, F.main("Disguise", "You cant buy things while you are disguised!")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java index 9a39e59f5..7897272a8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatCoal.java @@ -14,9 +14,9 @@ public class HatCoal extends HatGadget public HatCoal(GadgetManager manager) { - super(manager, "Lump of Coal", + super(manager, "Lump of Coal Hat", UtilText.splitLineToArray(C.cGray + "When life gives you coal, make a wierd cube hat out it!", LineFormat.LORE), - -3, + -1, new ItemStack(Material.COAL_BLOCK)); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 157ed982b..7358fe3da 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -3,6 +3,7 @@ package mineplex.core.gadget.gadgets.item; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Sound; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; @@ -24,67 +25,147 @@ import mineplex.core.common.util.UtilText; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent; import mineplex.core.gadget.gadgets.Ammo; +import mineplex.core.gadget.gadgets.hat.HatCoal; +import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; public class ItemCoal extends ItemGadget { - + public String[] Messages = new String[] { - "Maybe you could.... eat it?", - "Yep, you're holding some coal...", - "This sure is a nice piece of coal!", - "Na na na na Na na na na " + C.cDGray + "BLACK COAL" + C.mBody + "!", - "Did you know that coal can be used for " + C.Scramble + "nothing" + C.mBody + "!", + "Maybe you could.... eat it?", + "Yep, you're holding some coal...", + "This sure is a nice piece of coal!", + "Na na na na, Na na na na, " + C.cDGray + "BLACK COAL" + C.cGray + "!", + "Did you know that coal can be used for " + C.Scramble + "nothing" + C.mBody + "!", + "Now... if only you had a furnace.", + "I hope you didn’t miss any diamonds.", + "With 9 of these you could make a block!", + "Were you really that naughty this year?", + "With a few more of these you could make a snowman face!", + "Lava is hotter but Coal is quicker.", + "What do you even need Coal for on a Minigame server?", + "Maybe if I got more I could start a really big fire.", + "Maybe you can give this to your siblings next Christmas.", + "Did you know a diamond is formed from coal?", + "Coal is a word that sounds weird if you say it too much.", + "Who do you think mined the first block of coal?" }; public ItemCoal(GadgetManager manager) { super(manager, "Coal", - UtilText.splitLineToArray(C.cGray + "", LineFormat.LORE) - , -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] - { - C.cDGray + "Exclusive Coal!", + UtilText.splitLineToArray(C.cGray + "Just a large chunk of coal. Maybe you were naughty or something?", LineFormat.LORE) + , -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[] + { + C.cDGray + "Exclusive Coal!", C.cDGray + "Earned by beeing naughty" - } - , 1, 1)); + } + , -1, 1)); } @Override public void ActivateCustom(final Player player) { - if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) + //Coal Hat + if (!Manager.getGadget(HatCoal.class).ownsGadget(player)) { - Manager.getInventoryManager().addItemToInventory(new Callback() + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 50) { - @Override - public void run(Boolean data) - { - if(data) + Manager.getInventoryManager().addItemToInventory(new Callback() + { + @Override + public void run(Boolean data) { - player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Fumes" + C.cGray + ".")); - UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); - UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); - player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); - - Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); - player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); - } else { - player.sendMessage("Something went wrong..."); + if(data) + { + player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Hat" + C.cGray + ".")); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.1f, 0.5f, 0.1f, 0, 100, ViewDist.LONG); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 0.5f, 0.0f, 0.5f, 0, 100, ViewDist.LONG); + player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); + + Manager.getInventoryManager().addItemToInventory(player, GetName(), -50); + player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + } + else + { + player.sendMessage("Something went wrong..."); + } } - } - }, player, "Coal Fumes", 1); - return; + }, player, "Lump of Coal Hat", 1); + return; + } } - + + //Coal Apparition + if (!Manager.getPetManager().Get(player).GetPets().containsKey(EntityType.PIG_ZOMBIE)) + { + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 500) + { + Manager.getInventoryManager().addItemToInventory(new Callback() + { + @Override + public void run(Boolean data) + { + if(data) + { + player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Apparition Pet" + C.cGray + ".")); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.15f, 0.5f, 0.15f, 0, 250, ViewDist.LONG); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1f, 0.0f, 1f, 0, 250, ViewDist.LONG); + player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); + + Manager.getInventoryManager().addItemToInventory(player, GetName(), -500); + player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + } + else + { + player.sendMessage("Something went wrong..."); + } + } + }, player, "Coal Apparition", 1); + return; + } + } + + //Coal Particle + if (!Manager.getGadget(ParticleCoalFumes.class).ownsGadget(player)) + { + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) + { + Manager.getInventoryManager().addItemToInventory(new Callback() + { + @Override + public void run(Boolean data) + { + if(data) + { + player.sendMessage(F.main("Coal", "You unlocked " + C.cRed + "Mythical Coal Fumes Particle" + C.cGray + ".")); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); + player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); + + Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); + player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + } + else + { + player.sendMessage("Something went wrong..."); + } + } + }, player, "Coal Fumes", 1); + return; + } + } + int i = UtilMath.r(Messages.length); String msg = Messages[i]; player.sendMessage(F.main("Coal", msg)); player.playSound(player.getLocation(), Sound.GHAST_FIREBALL, 0.2f, 1.5f*(i/(float)Messages.length)); } - + @EventHandler @Override public void Activate(PlayerInteractEvent event) { @@ -101,21 +182,21 @@ public class ItemCoal extends ItemGadget if (!IsActive(player)) return; - + event.setCancelled(true); - + //Stock if (Manager.getInventoryManager().Get(player).getItemCount(GetName()) <= 0) { - + UtilPlayer.message(player, F.main("Gadget", "You do not have any " + GetName() + " left.")); - + ItemGadgetOutOfAmmoEvent ammoEvent = new ItemGadgetOutOfAmmoEvent(event.getPlayer(), this); Bukkit.getServer().getPluginManager().callEvent(ammoEvent); - + return; } - + //Recharge if (!Recharge.Instance.use(player, GetName(), GetName(), _recharge, _recharge > 1000, true, false, true, "Cosmetics")) { @@ -124,7 +205,7 @@ public class ItemCoal extends ItemGadget } player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); - + ActivateCustom(event.getPlayer()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java index 639ccea9f..b0d7bdae6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java @@ -141,7 +141,7 @@ public abstract class ItemGadget extends Gadget event.setCancelled(true); //Stock - if (Manager.getInventoryManager().Get(player).getItemCount(GetName()) <= 0) + if (!hasAmmo(player)) { UtilPlayer.message(player, F.main("Gadget", "You do not have any " + GetName() + " left.")); @@ -165,6 +165,11 @@ public abstract class ItemGadget extends Gadget ActivateCustom(event.getPlayer()); } + + public boolean hasAmmo(Player player) + { + return Manager.getInventoryManager().Get(player).getItemCount(GetName()) > 0; + } public abstract void ActivateCustom(Player player); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java index 5c0b7ed82..7d787f744 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/pet/types/PetCoalApparition.java @@ -8,7 +8,7 @@ public class PetCoalApparition extends Pet { public PetCoalApparition() { - super("Coal Apparition", EntityType.PIG_ZOMBIE, 10); + super("Coal Apparition", EntityType.PIG_ZOMBIE, -1); } } From 39f5f70a5f1acf5c4dac27c1c9fc813b103dd71c Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 22:43:34 +1100 Subject: [PATCH 32/51] fixing up coal things --- .../core/gadget/gadgets/item/ItemCoal.java | 43 +++++++++++++------ .../core/inventory/InventoryManager.java | 13 +++++- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 7358fe3da..a9e9ea591 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -30,6 +30,9 @@ import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.recharge.Recharge; +import mineplex.core.reward.RewardData; +import mineplex.core.reward.RewardRarity; +import mineplex.core.reward.rewards.PetReward; public class ItemCoal extends ItemGadget { @@ -75,6 +78,9 @@ public class ItemCoal extends ItemGadget { if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 50) { + Recharge.Instance.recharge(player, GetName()); + Recharge.Instance.use(player, GetName(), 60000, true, true); + Manager.getInventoryManager().addItemToInventory(new Callback() { @Override @@ -89,6 +95,8 @@ public class ItemCoal extends ItemGadget Manager.getInventoryManager().addItemToInventory(player, GetName(), -50); player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + + Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Lump of Coal Hat"); } else { @@ -105,12 +113,20 @@ public class ItemCoal extends ItemGadget { if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 500) { - Manager.getInventoryManager().addItemToInventory(new Callback() - { - @Override - public void run(Boolean data) - { - if(data) + Recharge.Instance.recharge(player, GetName()); + Recharge.Instance.use(player, GetName(), 60000, true, true); + + PetReward reward = new PetReward( + Manager.getPetManager(), + Manager.getInventoryManager(), + Manager.getDonationManager(), + "Coal Apparition", "Coal Apparition", EntityType.PIG_ZOMBIE, RewardRarity.OTHER, 0); + + if (reward.canGiveReward(player)) + reward.giveReward(null, player, new Callback() + { + @Override + public void run(RewardData data) { player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Apparition Pet" + C.cGray + ".")); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.15f, 0.5f, 0.15f, 0, 250, ViewDist.LONG); @@ -119,13 +135,11 @@ public class ItemCoal extends ItemGadget Manager.getInventoryManager().addItemToInventory(player, GetName(), -500); player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); - } - else - { - player.sendMessage("Something went wrong..."); + + Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Coal Apparition"); } - } - }, player, "Coal Apparition", 1); + }); + return; } } @@ -135,6 +149,9 @@ public class ItemCoal extends ItemGadget { if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) { + Recharge.Instance.recharge(player, GetName()); + Recharge.Instance.use(player, GetName(), 60000, true, true); + Manager.getInventoryManager().addItemToInventory(new Callback() { @Override @@ -149,6 +166,8 @@ public class ItemCoal extends ItemGadget Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); + + Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Coal Fumes"); } else { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java index 0a32aa977..a1d19bd53 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/inventory/InventoryManager.java @@ -138,7 +138,18 @@ public class InventoryManager extends MiniDbClientPlugin { public void run() { - addItemToInventoryForOffline(callback, PlayerCache.getInstance().getPlayer(uuid).getAccountId(), item, count); + try + { + addItemToInventoryForOffline(callback, PlayerCache.getInstance().getPlayer(uuid).getAccountId(), item, count); + } + catch (Exception e) + { + e.printStackTrace(); + + System.out.println("-----DEBUG-----"); + System.out.println("PlayerCache Instance: " + (PlayerCache.getInstance() == null)); + System.out.println("PlayerCache Player Object: " + (PlayerCache.getInstance().getPlayer(uuid) == null)); + } } }); } From d5612a8f2758e5e6f94e9e4df66c12346eea58d3 Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 23:09:06 +1100 Subject: [PATCH 33/51] added a hint to how many more coal you need to your next prize. --- .../core/gadget/gadgets/item/ItemCoal.java | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index a9e9ea591..5126b1f92 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -73,13 +73,17 @@ public class ItemCoal extends ItemGadget @Override public void ActivateCustom(final Player player) { + int goal = -1; + //Coal Hat if (!Manager.getGadget(HatCoal.class).ownsGadget(player)) { - if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 50) + goal = 250; + + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 250) { Recharge.Instance.recharge(player, GetName()); - Recharge.Instance.use(player, GetName(), 60000, true, true); + Recharge.Instance.use(player, GetName(), 30000, true, true); Manager.getInventoryManager().addItemToInventory(new Callback() { @@ -88,12 +92,12 @@ public class ItemCoal extends ItemGadget { if(data) { - player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Hat" + C.cGray + ".")); + Bukkit.broadcastMessage(F.main("Treasure", C.cGreen + player.getName() + C.cGray + " crafted " + C.cGreen + "Legendary Coal Hat")); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.1f, 0.5f, 0.1f, 0, 100, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 0.5f, 0.0f, 0.5f, 0, 100, ViewDist.LONG); player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); - Manager.getInventoryManager().addItemToInventory(player, GetName(), -50); + Manager.getInventoryManager().addItemToInventory(player, GetName(), -250); player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Lump of Coal Hat"); @@ -111,10 +115,12 @@ public class ItemCoal extends ItemGadget //Coal Apparition if (!Manager.getPetManager().Get(player).GetPets().containsKey(EntityType.PIG_ZOMBIE)) { - if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 500) + goal = 1000; + + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) { Recharge.Instance.recharge(player, GetName()); - Recharge.Instance.use(player, GetName(), 60000, true, true); + Recharge.Instance.use(player, GetName(), 30000, true, true); PetReward reward = new PetReward( Manager.getPetManager(), @@ -128,12 +134,12 @@ public class ItemCoal extends ItemGadget @Override public void run(RewardData data) { - player.sendMessage(F.main("Coal", "You unlocked " + C.cGreen + "Legendary Coal Apparition Pet" + C.cGray + ".")); + Bukkit.broadcastMessage(F.main("Treasure", C.cGreen + player.getName() + C.cGray + " crafted " + C.cGreen + "Legendary Coal Apparition Pet")); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.15f, 0.5f, 0.15f, 0, 250, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1f, 0.0f, 1f, 0, 250, ViewDist.LONG); player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); - Manager.getInventoryManager().addItemToInventory(player, GetName(), -500); + Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Coal Apparition"); @@ -147,10 +153,12 @@ public class ItemCoal extends ItemGadget //Coal Particle if (!Manager.getGadget(ParticleCoalFumes.class).ownsGadget(player)) { - if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000) + goal = 2500; + + if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 2500) { Recharge.Instance.recharge(player, GetName()); - Recharge.Instance.use(player, GetName(), 60000, true, true); + Recharge.Instance.use(player, GetName(), 30000, true, true); Manager.getInventoryManager().addItemToInventory(new Callback() { @@ -159,12 +167,12 @@ public class ItemCoal extends ItemGadget { if(data) { - player.sendMessage(F.main("Coal", "You unlocked " + C.cRed + "Mythical Coal Fumes Particle" + C.cGray + ".")); + Bukkit.broadcastMessage(F.main("Treasure", C.cRed + player.getName() + C.cGray + " crafted " + C.cRed + "Mythical Coal Fumes Particles")); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG); UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG); player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0); - Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000); + Manager.getInventoryManager().addItemToInventory(player, GetName(), -2500); player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName()))); Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Coal Fumes"); @@ -179,10 +187,23 @@ public class ItemCoal extends ItemGadget } } - int i = UtilMath.r(Messages.length); - String msg = Messages[i]; - player.sendMessage(F.main("Coal", msg)); - player.playSound(player.getLocation(), Sound.GHAST_FIREBALL, 0.2f, 1.5f*(i/(float)Messages.length)); + goal -= Manager.getInventoryManager().Get(player).getItemCount(GetName()); + + if (goal > 0 && Math.random() > 0.95) + { + player.sendMessage(F.main("Coal", "Only " + goal + " to go...")); + + player.playSound(player.getLocation(), Sound.IRONGOLEM_DEATH, 0.2f, 0.5f); + } + else + { + + int i = UtilMath.r(Messages.length); + String msg = Messages[i]; + player.sendMessage(F.main("Coal", msg)); + + player.playSound(player.getLocation(), Sound.GHAST_FIREBALL, 0.2f, 1.5f*(i/(float)Messages.length)); + } } @EventHandler @Override From 2ffd1d4595d9d3c59209448d27cee59523cf10ef Mon Sep 17 00:00:00 2001 From: Cheese Date: Fri, 11 Dec 2015 23:11:33 +1100 Subject: [PATCH 34/51] BOB ROSS --- .../src/mineplex/core/gadget/gadgets/item/ItemCoal.java | 3 ++- .../src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java index 5126b1f92..e0585758a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemCoal.java @@ -55,7 +55,8 @@ public class ItemCoal extends ItemGadget "Maybe you can give this to your siblings next Christmas.", "Did you know a diamond is formed from coal?", "Coal is a word that sounds weird if you say it too much.", - "Who do you think mined the first block of coal?" + "Who do you think mined the first block of coal?", + "Maybe if you get enough, something cool will happen! Or perhaps not...", }; public ItemCoal(GadgetManager manager) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java index 2815a9b5e..790a66d44 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPaintbrush.java @@ -200,7 +200,7 @@ public class ItemPaintbrush extends ItemGadget Villager villager = (Villager)event.getRightClicked(); - if (villager.getCustomName() != null && villager.getCustomName().contains("Painter")) + if (villager.getCustomName() != null && villager.getCustomName().contains("Bob Ross")) { Enable(event.getPlayer()); } From ba087d119a0860b13da482aadd5de1753ef53537 Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Fri, 11 Dec 2015 17:31:05 +0100 Subject: [PATCH 35/51] Small tweaks --- .../src/mineplex/core/cosmetic/ui/page/Menu.java | 4 ++-- .../gadget/gadgets/item/ItemPartyPopper.java | 16 ++++++++-------- .../core/gadget/gadgets/item/ItemSnowball.java | 2 +- .../gadgets/particle/ParticleCoalFumes.java | 9 +++++---- .../core/mount/types/MountBabyReindeer.java | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index 143794f24..79edde702 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -47,7 +47,7 @@ public class Menu extends ShopPageBase @Override protected void buildPage() { - Donor donor = getDonationManager().Get(getPlayer()); +// Donor donor = getDonationManager().Get(getPlayer()); // addItem(2, new ShopItem(CurrencyType.Gems.GetDisplayMaterial(), donor.GetGems() + " Gems", new String[] { // " " @@ -83,7 +83,7 @@ public class Menu extends ShopPageBase addButton(46, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this)); addButton(48, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); addButton(50, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); - addButton(52, new ShopItem(Material.NAME_TAG, "Taunts", 1, false), new IButton() + addButton(52, new ShopItem(Material.NAME_TAG, "Taunts", new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false), new IButton() { @Override public void onClick(Player player, ClickType clickType) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java index 2a44e16da..ee3530375 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -9,16 +9,15 @@ import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.util.Vector; import mineplex.core.common.util.C; -import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.gadgets.Ammo; import mineplex.core.gadget.types.ItemGadget; -import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; import mineplex.core.updater.UpdateType; @@ -43,19 +42,20 @@ public class ItemPartyPopper extends ItemGadget implements IThrown @Override public void ActivateCustom(Player player) { - + /* Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random())); UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false); Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); + */ + - /* for(int data : new int[]{1,2,4,5,6,9,10,11,12,13,14,15}) { - UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), null, 0.4f, 50, ViewDist.LONG); - /* +// UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), null, 0.4f, 50, ViewDist.LONG); + for(int i = 0; i < 10; i++) { Vector v = new Vector(Math.random() - 0.5, Math.random() - 0.3, Math.random() - 0.5); @@ -75,12 +75,12 @@ public class ItemPartyPopper extends ItemGadget implements IThrown Vector random = new Vector(Math.random() - 0.5, Math.random() - 0.3, Math.random() - 0.5); random.normalize(); random.multiply(0.05); - + UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.3).add(random), 1 + 0.4 * Math.random(), false, 0, 0.2, 10, false); Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f); */ -// } + } // Sound for(int i = 0; i < 3; i++) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java index ce1f5dc79..447d7ea2e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSnowball.java @@ -54,7 +54,7 @@ public class ItemSnowball extends ItemGadget if(gevent.isCancelled()) return; - UtilAction.velocity(event.getEntity(), event.getDamager().getVelocity().normalize().add(new Vector(0,0.5,0))); + UtilAction.velocity(event.getEntity(), event.getDamager().getVelocity().normalize().add(new Vector(0,0.5,0)).multiply(0.5)); event.getDamager().getWorld().playSound(event.getDamager().getLocation(), Sound.STEP_SNOW, 1, 0.5f); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java index 04ccec81d..edfb6cf62 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java @@ -29,12 +29,13 @@ public class ParticleCoalFumes extends ParticleGadget { if(event.getType() != UpdateType.TICK) return; - int dur = 200; - int tick = Math.abs(event.getTick()%dur); +// int dur = 200; +// int tick = Math.abs(event.getTick()%dur); - double d = tick/(double)dur; - float xz = (float) Math.sin(d*Math.PI); +// double d = tick/(double)dur; +// float xz = (float) Math.sin(d*Math.PI); + float xz = 2; for(Player p : GetActive()) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java index 0c5b84e98..9293a0636 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java @@ -33,7 +33,7 @@ public class MountBabyReindeer extends HorseMount { C.cWhite + "One of Santa's baby reindeers", C.cWhite + "Still trying to learn how to fly" - }, Material.SNOW_BALL, (byte) 0, 10, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); + }, Material.GOLDEN_CARROT, (byte) 0, 10, Color.CREAMY, Style.WHITEFIELD, Variant.HORSE, 0, null); } @EventHandler From 011a194dc641a5ae67d76b07c39bf428df0d60a2 Mon Sep 17 00:00:00 2001 From: Cheese Date: Sun, 13 Dec 2015 21:14:57 +1100 Subject: [PATCH 36/51] fixed exploit --- .../src/nautilus/game/arcade/managers/HolidayManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java index ba2c0d8cd..2328f93dc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/HolidayManager.java @@ -304,14 +304,16 @@ public class HolidayManager implements Listener if (Manager.GetGame() != null && !Manager.GetGame().IsAlive(event.getPlayer())) return; - if (!_active.contains(event.getClickedBlock())) - return; - specialBlockBreak(event.getPlayer(), event.getClickedBlock()); } private void specialBlockBreak(Player player, final Block block) { + if (!_active.contains(block)) + return; + + _active.remove(block); + block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType()); block.setType(Material.AIR); From 64fb2b11d853f0d19aecb984be9285f9e7ebdcde Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Sun, 13 Dec 2015 23:09:25 +0100 Subject: [PATCH 37/51] Added fake skin data +Moved hats to use fake non-changing skin data +Added Rudolph hat +Added Grinch hat +Added suport for fake skins on DisguisePlayer +Tweaked PartyPopper --- .../mineplex/core/common/skin/SkinData.java | 84 +++++++++++++++++++ .../core/cosmetic/ui/page/GadgetPage.java | 35 +++++++- .../core/cosmetic/ui/page/HatPage.java | 11 --- .../core/disguise/DisguiseManager.java | 63 +++++++------- .../disguise/disguises/DisguisePlayer.java | 33 ++++++-- .../mineplex/core/gadget/GadgetManager.java | 2 + .../core/gadget/gadgets/hat/HatGrinch.java | 3 +- .../core/gadget/gadgets/hat/HatPresent.java | 3 +- .../core/gadget/gadgets/hat/HatRudolph.java | 21 +++++ .../core/gadget/gadgets/hat/HatSanta.java | 3 +- .../core/gadget/gadgets/hat/HatSnowman.java | 3 +- .../gadget/gadgets/item/ItemPartyPopper.java | 2 +- .../mineplex/core/gadget/types/HatGadget.java | 6 ++ 13 files changed, 212 insertions(+), 57 deletions(-) create mode 100644 Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatRudolph.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java new file mode 100644 index 000000000..02e8f476a --- /dev/null +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/skin/SkinData.java @@ -0,0 +1,84 @@ +package mineplex.core.common.skin; + +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.properties.Property; + +import net.minecraft.server.v1_8_R3.Item; +import net.minecraft.server.v1_8_R3.MinecraftKey; +import net.minecraft.server.v1_8_R3.NBTTagCompound; +import net.minecraft.server.v1_8_R3.NBTTagList; +import net.minecraft.server.v1_8_R3.NBTTagString; + +public class SkinData +{ + + private static long _nameCount = -99999999999999L; + + public final static SkinData MOOSHROOM = new SkinData("eyJ0aW1lc3RhbXAiOjE0NDk4NzI0OTU0MTcsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIxOWJlYTU0Y2FkN2Q1OGFiNWRhNDA2YjBhOTJhYjNhODI0MjI1MjY2Nzc3ZTUzNGI3ZGI2YzM3MmRkZmY3ZiJ9fX0=","UoSif81+UyvkcaanU8KAMYBpw9mefAmWehE2liDUFvk+y0X/9NovsxTYVpIDCltTSpLW3sNgamvbj4Ybs+s6DbudPiEkvh0ER7Bv2v29UJw7RzIdr6/1g548X12zcnh5iPGz/P75uNRnSfTFQx0ed8P/GNkPIjWpDuJFxEj6KcPzrCAGMx+BVw1VwryBIYf9cCDHky8z0bxR89rjiIvPTBFI6MRhqI3vgpEBTySHDS+Ki0Hwl5oa3PwS6+jgYx/4RSfFsb+BawcvDk2Xpkt5UimvqZ5BceYLIfCt4KbShYipgLXLfYUZrntjPemd3SxthjxUuA07i44UxRdiC8uqy1twLT/HUS28gpk68lA/id9tKFwu1CUzshgcmvQPt3ghtNViNziR/2t7D/+5D31Vzmhf6n7Pnpdirt/5frMi2BKMMs7pLa0EF8CrrDU7QCwPav+EZVGFvVZbxSkCDq+n3IQ3PUWSCzy6KPxpdOlUjD0pAfLoiNj0P8u4+puQtID76r/St8ExchYl2dodUImu1ZETWeFUClF3ZGat62evx8uRQEI2W4dsVwj40VUfjaAuvyDzuouaKTrCzJXLQZZjR1B8URvuK61fGX0nhW607mEi6DE+nxP2ZoBrROEX4e37Ap6+TQn9Q8tKDPdcxtwSOpPO4Qkncjn/mGtP9lZU/DQ="); + public final static SkinData SANTA = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTAwMTk4Nzk5NDIsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzEzMTgxYWViODQzODk3NzM1ZDQwMmIyNDk2OTQxNmZkYjBjZTM0YTZiOTM3ODE2MjQzNzU2ZTlkYWU1OGUzIn19fQ==","NZvsNu+HQ5uvGWq6O8VNDGq9A145bmk2IkHiz916uRVPMRqqCI/zwhKWNLlFACE/feuLkhYAois29ec6sVVOtHIoNA+S5q1Mb/Vjc3TJQxzqmx2FZOhJiIttFwYuo9WomQKBqrPMSJ9tpQig4wzoqldeeTjWC3dLz7JeX+gkzinryVjG7NNN9L5hXK5/BBxRcrtwmXJfUlSANyrd8RZW7mEUgU8yxlzdqTu0w7bZLjQNd4vciwoF3NelXDorMIIqiHTkuQesG91Njtu25VCUDK3nXbqEnZw2ZtxB5fT5G2Omm/vkNSRXc0P7iqchVowdYQcMlQUsp65xpkBbFS4LwjzDkYIfLmF++hePb8z72Gz77FxhO5sRLGreSH227McyL/0CtWNKm9ZZIfQtZZjEZTj9+eiJMCloCMg3yWa1VBOiLHzz0wY6gGklccIImPyXEg7E0dIK8qYseJMhmmBNZ8pDOkbUDp3mRlrQ2iyClgQkbuR63j79IBUaCxmsa3NnrAtaJklzd9mzkHXfMBh2XT7Gl8AhJS6JK5kCvip1rBBI8yjrsjE/E+lyJFIbC4rXxyMDGZWkcdrd7U4ZFYKiLHbzdFRqX+11qs9xO2BvomGXkATCzYmOf2kQ86R6rNN0+JfE4QpKzj2WWt3C8ky2qpuXZz29p0816E3/qseYtgg="); + public final static SkinData SNOWMAN = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTAwMTk3OTM3NTgsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2MyNTM5ZGFkZDUxYmE5ZTg0YzFhOTE1OTY3NWUxZTJiYWM1NmFlNmFlNTMxNTQyZDI1YTlkM2Q1YzQ2ODZmNiJ9fX0=","gvLc0Vo6+1vl17vrFCbK1eNqa4/ix4xiwcWae7WOCvqiVIX4sdIPagOGUrKsDdEhuWCKkTWILGP1K3wYfC9v/0mXZvbu0sRln+APTOsswMkQmbKcA1zTFTMpwEI+nIMzYJSbIx5wjz28K5hDf/umtHH2GADTENdJGGUtU4CyEdeHTzcqIAEV3bcMLkfTKvwKUWqI5gZbbercqmDeGkmXVS9297a9paRX1NfEL9pFT0pjdH3tCjgvvKfAwGC6tYtvTFbfcJocqgI+PI2f5OFf62A4XjWwWFi4wxCHVYNpqs/XTbfF64K7KVE0d9gsLjJoB8DMZPxlNpMFA0R5OIW6Q7Qjyz9IKxUqEYRCQbuUKpHyNDcmVKcTJRwBpCHeqAbTbweZHd5tzrT/terWhLEMsK1+lH2KBfIRIRB9kd3epyShNjSEKoly6uRXVxU+IJtfcq0aFVZlwgG3c1Ds9jbsNJV158e1n6WCmvT00RLdvpcIekwUKODhi3zFeFkrVvV50tGYqXLRZenitLJvDzx4c0IGK4krALrUS0oybinBS7/GmW3Ktz3xbGKZSzzaDw0EKB7Y6XHdb4yqR1xS7lAWgv4cNDEIUSzUDJ7HpmDCIF2A5kPS4XVYFCclyR6qPGD5e+9apVhBMz4lfYlT1IfRAUQlucO4UpAlkXs7ho3pQXU="); + public final static SkinData PRESENT = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTAwMTk3MDIxNjIsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2U2YzRkZWQwNTdjMjhiMTU0NjVkYzQzNmFmODIyYTNkZTY4NzgyZTZjMzgyOGMzMmFhYWE4ZjRiOTIzOWVjIn19fQ==","rJNlxTqHHmOoWwbXdMQLcj0P9w/PIr/hWKXH0nbhm/S2CFo/zfefffZlnQmpKCgn1Y8tXvcRwLGQ4CLpm9m2ZrKprSWRhrnOtZWYabrhExQESEammS3TY81VoNt+4On0pAGBippz/bRfWLuDne2rDbhuljnqvxjROmxpky7gRCU06VMlm2WLFC5XYJkiAaOXBqzpiHMMRPNnCvtcbtpILKi/Luj302eyN8nRKjHHbbiDmttwvlshxZ8UxJHvALtM506IUHba10Q6QX2zCeDAU5/WYRKa6e19r8plROcgGbKYFSq8JW5cWuWT3/rveZM6FnU6ABn9DWsCyfQ5wr2jdBd+xaevGTAScRHA5J493GqL1bBZYKj9yhQFtxJHCAf0++raAVPCZgyPtwTth4TAQisn8gnhM5R+txnW6xK+oflLy0dwEN1YdPLN/h7yuDnyjSMDe9RZT2NKMjok2C6Kux4WBI0KFXKC5Gqwa3Htku4v3WEOWMaVoWOtchQ9BzpQ/etD0ylmzjALQLB+HtndEEm1Jd3tmob42X4hBE8hCce7C3EtGINB33dlx4CK1xBqyGTJEqi69DJRzVL99u98+7kJ1Db9+MaPOfI4B2RY3XbvnSYwecandY//A3bb19FGSdl299ZXbp4zpm8fivzeB1rUAhhmtaA3Iwu/nEQNMkU="); + public final static SkinData RUDOLPH = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTAwMTk1NjgxODIsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2IzZjdlMjhiNTJkZjJjZjhlZWM2NDk2ZmM0NWFlMGQ2NTM0Njc5OGIxYWRjNzM3ZDcxYzBmOTRlNDIyMSJ9fX0=","uUBOTe63CL+qRvtsb2g4AjB2YzxE3N6AUqIsTv8n0jYyPsuXpuOmZPSMEdgDVONywEJ1L4XRx05sjnGu56A8vuXmGI/uHQWuMZzbOSjiFfT3DkEm8zEl5AWpH9dz/t8nZ1WYUIwy0pN5VrZqIr1DAkF6AMh/Qy+FGDw1GG9ReRr80eJ0JiRskpkCpCZIGGjrgwNKAM8JOuNZ4gCQOTRC3etrcfls3qmUMFcVlhuB4bydxSR01i2w0A4b5KpufsJjLKw4InWn2+m/druo8hl9sYuusTeItW0MQmZqCAqXCc9YBnRPQ0hDXFgnPxOh3RwGWiZvL4MnWUVmLwZWh/Fk9QmyVbd7zVao0lxS8YNsKtP8j5B+hs4l9qNohhf0A07bt4oPeTtd5fQeOU5N87fUGuUAcpC4gP9U5WpVY5FFPBvLvGbXdV5jpuAQz4lLSoo1grsP9baR2IBvdN/0awjQWoPJfGOttegubkBHwz3LNcVqvZLtX/M13IDHZa6zQZEX0wsnMX60LeWgBWfTON1l2cSgaPTerHFS2EifJ2LvTBife3s9/4XR6Zth3FLFqxI3MSlqT2hVFRPLke6rBqfqPoWOj2MCykQ70IAwb3oTHcJDJ86V2DdNaU2bZ8V4TjaP+nRobsLJOImoPYEPq23MP36X8gbXEIjmuu8S5xRlrrc="); + public final static SkinData THE_GRINCH = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTAwMTYxNDMwMDQsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzg4ZWRlOTI3ZDQzOWVmMzliMzFhYzFkYzJhODM5NGZlNzlhY2U4NDMyNzBjYmUxMjg2ZGM3NTE3ZjMxYTk2In19fQ==","ELo594vTzPq9ZmPYOtVr4kim/k19gzmoxEIK1ehS87gwgag5HcgM+P1FMnHIyrmSvTVaMh0NxwXmNS+JETFL7OrmgRYNpkxkkO4VBA0pfSn3dA9ujnXpDnDiWEPxKdMgQspIOOI0Z3esNt3pj8qIj6dWPtGwtso48tjHl2o/kazfa82yvGORlFhGkeEJKQMno/Buc12C0foQw39XI8GjvlSkFN2eH4Fp16RLu8/hf7SqJQC3L1KacvzMW1d8BWEIgACCJDni29+YqxflSqSyYrV4Z+D66S0jYvUUL/vM4/q/p/YWX/vs/FtMtHQTj4PCpAmMNTgfkahuhb6rCvKHukbjA+WhUdwyxSqXU5YnpXCu1M2dzZgiXjIi+fnyn4CmXKindWCQtSwu+mCA2ILv/6vEHoYJgdlz+DXyRkFx+DH4Sl74HBCOXTOq5AGjq5h3LYfsre+UjCCUv8VgxbVprOyj35So7K0m+6faCFVSt35T3RgicDQfdiWUrW7kmHQVvJpvaq9Vu+63F/0X93cwqwaR0buMirxRx7qkFrRunSI4T+9fsN02t1fAieeu80lBSv83wr7BFneSsLsdVAND9xttTb6fClg7anr8/XVEVIkylB4B+ZcWQbH61XP1nn7oFP2VBg1h6XuuLp8FGSgYf/LW+54/KZci/MnanqQE6QQ="); + + private Property _skinProperty; + + public SkinData(String value, String signature) + { + _skinProperty = new Property("textures", value, signature); + } + + public SkinData(GameProfile profile) + { + _skinProperty = profile.getProperties().get("textures").iterator().next(); + } + + public SkinData(Player player) + { + this(((CraftPlayer)player).getProfile()); + } + + public ItemStack getSkull() + { + NBTTagCompound arrayElement = new NBTTagCompound(); + arrayElement.setString("Value", _skinProperty.getValue()); + arrayElement.setString("Signature", _skinProperty.getSignature()); + + NBTTagList textures = new NBTTagList(); + textures.add(arrayElement); + + NBTTagCompound properties = new NBTTagCompound(); + properties.set("textures", textures); + + NBTTagCompound skullOwner = new NBTTagCompound(); + skullOwner.set("Properties", properties); + skullOwner.set("Name", new NBTTagString(getUnusedSkullName())); + + NBTTagCompound tag = new NBTTagCompound(); + tag.set("SkullOwner", skullOwner); + + + net.minecraft.server.v1_8_R3.ItemStack nmsItem = new net.minecraft.server.v1_8_R3.ItemStack(Item.REGISTRY.get(new MinecraftKey("skull")), 1, 3); + nmsItem.setTag(tag); + + + return CraftItemStack.asBukkitCopy(nmsItem); + } + + public Property getProperty() + { + return new Property(_skinProperty.getName(), _skinProperty.getValue(), _skinProperty.getSignature()); + } + + public static String getUnusedSkullName() + { + _nameCount++; + return "_" + _nameCount; + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java index 8b89c1c83..de8ac1f19 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/GadgetPage.java @@ -4,11 +4,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import net.md_5.bungee.api.ChatColor; - +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import mineplex.core.account.CoreClientManager; import mineplex.core.common.CurrencyType; @@ -24,6 +25,7 @@ import mineplex.core.donation.DonationManager; import mineplex.core.gadget.gadgets.morph.MorphBlock; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; +import mineplex.core.gadget.types.HatGadget; import mineplex.core.gadget.types.ItemGadget; import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; @@ -188,6 +190,35 @@ public class GadgetPage extends ShopPageBase return; } + if(gadget instanceof HatGadget) + { + ItemStack item = ((HatGadget)gadget).getHelmetItem(); + + ItemMeta im = item.getItemMeta(); + im.setDisplayName(C.cGreen + C.Bold + gadget.GetName()); + + if (gadget.GetActive().contains(getPlayer())) + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Disable"); + + im.setLore(itemLore); + item.setItemMeta(im); + addButton(slot, new ShopItem(item, false, false), new DeactivateGadgetButton(gadget, this)); + } + else + { + itemLore.add(C.cBlack); + itemLore.add(C.cGreen + "Click to Enable"); + + im.setLore(itemLore); + item.setItemMeta(im); + addButton(slot, new ShopItem(item, false, false), new ActivateGadgetButton(gadget, this)); + } + + return; + } + //Standard if (gadget.ownsGadget(getPlayer())) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java index 4ff3ded5a..8ea9fff22 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/HatPage.java @@ -5,8 +5,6 @@ import java.util.List; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.SkullMeta; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.C; @@ -15,7 +13,6 @@ import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; -import mineplex.core.gadget.types.HatGadget; import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; @@ -40,14 +37,6 @@ public class HatPage extends GadgetPage { addGadget(gadget, slot); - ItemStack item = getItem(slot); - if(item.getType() == Material.SKULL_ITEM) - { - SkullMeta data = (SkullMeta) item.getItemMeta(); - data.setOwner(((SkullMeta)((HatGadget)gadget).getHelmetItem().getItemMeta()).getOwner()); - item.setItemMeta(data); - } - if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget) addGlow(slot); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 4b39e5a77..ee25da25d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -9,35 +9,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; -import net.minecraft.server.v1_8_R3.Block; -import net.minecraft.server.v1_8_R3.BlockPosition; -import net.minecraft.server.v1_8_R3.Chunk; -import net.minecraft.server.v1_8_R3.ChunkSection; -import net.minecraft.server.v1_8_R3.EntityTrackerEntry; -import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation; -import net.minecraft.server.v1_8_R3.EntityPlayer; -import net.minecraft.server.v1_8_R3.Packet; -import net.minecraft.server.v1_8_R3.PacketPlayOutBed; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntity; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityStatus; -import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk; -import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunkBulk; -import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn; -import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook; -import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.PlayerInfoData; -import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityVelocity; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; -import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; -import net.minecraft.server.v1_8_R3.PacketPlayOutUpdateAttributes; -import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment; -import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect; -import net.minecraft.server.v1_8_R3.WorldServer; - import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -73,11 +44,39 @@ import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.disguise.disguises.DisguiseRabbit; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketHandler; -import mineplex.core.packethandler.PacketVerifier; import mineplex.core.packethandler.PacketInfo; +import mineplex.core.packethandler.PacketVerifier; import mineplex.core.timing.TimingManager; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import net.minecraft.server.v1_8_R3.Block; +import net.minecraft.server.v1_8_R3.BlockPosition; +import net.minecraft.server.v1_8_R3.Chunk; +import net.minecraft.server.v1_8_R3.ChunkSection; +import net.minecraft.server.v1_8_R3.EntityPlayer; +import net.minecraft.server.v1_8_R3.EntityTrackerEntry; +import net.minecraft.server.v1_8_R3.Packet; +import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation; +import net.minecraft.server.v1_8_R3.PacketPlayOutBed; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntity; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityStatus; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; +import net.minecraft.server.v1_8_R3.PacketPlayOutEntityVelocity; +import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk; +import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunkBulk; +import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect; +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; +import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.PlayerInfoData; +import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity; +import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_8_R3.PacketPlayOutUpdateAttributes; +import net.minecraft.server.v1_8_R3.WorldServer; public class DisguiseManager extends MiniPlugin implements IPacketHandler { @@ -382,9 +381,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler for (Player player : players) addViewerToDisguise(disguise, player, false); - if (disguise.GetEntity() instanceof Player && disguise instanceof DisguisePlayer) + if (disguise.GetEntity() instanceof EntityPlayer && disguise instanceof DisguisePlayer) { - if (!((Player) disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer) disguise).getName())) + if (!((EntityPlayer) disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer) disguise).getName())) { _blockedNames.add(((Player) disguise.GetEntity()).getName()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java index d5f933f83..d81a3086e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/disguises/DisguisePlayer.java @@ -2,29 +2,25 @@ package mineplex.core.disguise.disguises; import java.util.UUID; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; -import org.bukkit.entity.Player; import com.mojang.authlib.GameProfile; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; +import mineplex.core.common.skin.SkinData; import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.Packet; -import net.minecraft.server.v1_8_R3.PacketPlayInSettings; import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo; -import net.minecraft.server.v1_8_R3.WorldSettings; import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction; +import net.minecraft.server.v1_8_R3.WorldSettings; public class DisguisePlayer extends DisguiseHuman { private GameProfile _profile; private boolean _sneaking; private BlockFace _sleeping; + private boolean _sendSkinToSelf; public DisguisePlayer(org.bukkit.entity.Entity entity) { @@ -46,6 +42,29 @@ public class DisguisePlayer extends DisguiseHuman _profile = newProfile; } + + public GameProfile getProfile() + { + return _profile; + } + + public void setSkinData(SkinData skin) + { + _profile.getProperties().put("textures", skin.getProperty()); + } + + /** + * Currently not working. + */ + public void setSendSkinDataToSelf(boolean sendToSelf) + { + _sendSkinToSelf = sendToSelf; + } + + public boolean getSendSkinDataToSelf() + { + return _sendSkinToSelf; + } public BlockFace getSleepingDirection() { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 8439e08cb..ae95d1832 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -205,6 +205,8 @@ public class GadgetManager extends MiniPlugin addGadget(new HatSnowman(this)); addGadget(new HatPresent(this)); addGadget(new HatCoal(this)); + addGadget(new HatRudolph(this)); + addGadget(new HatGrinch(this)); // Music addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000)); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java index aee21df5b..45cc41fd2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatGrinch.java @@ -1,5 +1,6 @@ package mineplex.core.gadget.gadgets.hat; +import mineplex.core.common.skin.SkinData; import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilText; @@ -14,7 +15,7 @@ public class HatGrinch extends HatGadget super(manager, "The Grinch", UtilText.splitLineToArray(C.cGray + "Great! Now where’s the Roast Beast?!", LineFormat.LORE), -3, - "christmasgift"); + SkinData.THE_GRINCH.getSkull()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java index 16d6fdd2f..d02b55944 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatPresent.java @@ -1,5 +1,6 @@ package mineplex.core.gadget.gadgets.hat; +import mineplex.core.common.skin.SkinData; import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilText; @@ -14,7 +15,7 @@ public class HatPresent extends HatGadget super(manager, "Present", UtilText.splitLineToArray(C.cGray + "WHAT IN THE PRESENT? Oh, it's just you...", LineFormat.LORE), -3, - "christmasgift"); + SkinData.PRESENT.getSkull()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatRudolph.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatRudolph.java new file mode 100644 index 000000000..1dfd9fa5c --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatRudolph.java @@ -0,0 +1,21 @@ +package mineplex.core.gadget.gadgets.hat; + +import mineplex.core.common.skin.SkinData; +import mineplex.core.common.util.C; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.HatGadget; + +public class HatRudolph extends HatGadget +{ + + public HatRudolph(GadgetManager manager) + { + super(manager, "Rudolph", + UtilText.splitLineToArray(C.cGray + "WHAT IN THE PRESENT? Oh, it's just you...", LineFormat.LORE), + -3, + SkinData.RUDOLPH.getSkull()); + } + +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java index fa572fed3..d49221995 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSanta.java @@ -1,5 +1,6 @@ package mineplex.core.gadget.gadgets.hat; +import mineplex.core.common.skin.SkinData; import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilText; @@ -14,7 +15,7 @@ public class HatSanta extends HatGadget super(manager, "Santa", UtilText.splitLineToArray(C.cGray + "Now you can work the Mall circuit!", LineFormat.LORE), -3, - "Presents"); + SkinData.SANTA.getSkull()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java index 9d02dd720..1f2b44ab6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/hat/HatSnowman.java @@ -1,5 +1,6 @@ package mineplex.core.gadget.gadgets.hat; +import mineplex.core.common.skin.SkinData; import mineplex.core.common.util.C; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilText; @@ -14,7 +15,7 @@ public class HatSnowman extends HatGadget super(manager, "Snowmans Head", UtilText.splitLineToArray(C.cGray + "Do you want to be a snowman?", LineFormat.LORE), -3, - "snowman002"); + SkinData.SNOWMAN.getSkull()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java index 8082041b5..92da2218c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -69,7 +69,7 @@ public class ItemPartyPopper extends ItemGadget implements IThrown UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), v, 1, 0, ViewDist.LONG); } - + /* Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)data, 1, "Ink" + Math.random())); _items.add(ent); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java index 91d5c2da7..9e2ebc269 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java @@ -4,8 +4,10 @@ import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; +import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.core.gadget.GadgetManager; @@ -19,6 +21,10 @@ public abstract class HatGadget extends OutfitGadget { super(manager, name, desc, cost, ArmorSlot.Helmet, item.getType(), item.getData().getData()); _hat = item; + + ItemMeta im = _hat.getItemMeta(); + im.setDisplayName(C.cGreen + C.Bold + name); + _hat.setItemMeta(im); } public HatGadget(GadgetManager manager, String name, String[] desc, int cost, String playerName) From 35ab40727bee2035cc21a71f7494b54126d8abd1 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 18:55:21 -0500 Subject: [PATCH 38/51] XMAS UPDATE OMG :O --- Plugins/Mineplex.Core/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../mineplex/hub/server/ServerManager.java | 2 +- .../hub/server/ui/ServerGameMenu.java | 4 +- .../src/nautilus/game/arcade/game/Game.java | 39 ++- .../nautilus/game/arcade/game/SoloGame.java | 12 +- .../game/games/christmas/Christmas.java | 140 +++++++++-- .../arcade/game/games/christmas/Sleigh.java | 235 +++++++++++------- .../game/games/christmas/SleighHorse.java | 34 +-- .../game/games/christmas/SleighPart.java | 93 ++++--- .../games/christmas/content/BossFloor.java | 24 +- .../game/games/christmas/content/IceMaze.java | 27 +- .../games/christmas/content/SnowmanBoss.java | 16 +- .../games/christmas/content/SnowmanMaze.java | 109 +++++--- .../christmas/content/SnowmanWaypoint.java | 6 + .../game/games/christmas/kits/KitPlayer.java | 19 +- .../game/games/christmas/parts/Part.java | 147 +++++++---- .../game/games/christmas/parts/Part1.java | 36 ++- .../game/games/christmas/parts/Part4.java | 43 ++-- .../game/games/christmas/parts/Part5.java | 37 ++- 20 files changed, 682 insertions(+), 349 deletions(-) diff --git a/Plugins/Mineplex.Core/.classpath b/Plugins/Mineplex.Core/.classpath index ea3a54132..067e728d7 100644 --- a/Plugins/Mineplex.Core/.classpath +++ b/Plugins/Mineplex.Core/.classpath @@ -1,7 +1,7 @@ - + diff --git a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs index d17b6724d..a698e5967 100644 --- a/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs +++ b/Plugins/Mineplex.Core/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,12 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java index 10f889fce..83962381a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ServerManager.java @@ -862,7 +862,7 @@ public class ServerManager extends MiniPlugin public ShopBase getMinestrikeShop() { - return _serverNpcShopMap.get("Mine-Strike"); + return _serverNpcShopMap.get("MineStrike"); } public ShopBase getWizardShop() diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 4e3bc8320..f33ab68fe 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -4,8 +4,8 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.ChatColor; -import org.bukkit.entity.Player; import org.bukkit.Material; +import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.account.CoreClientManager; @@ -127,7 +127,7 @@ public class ServerGameMenu extends ShopPageBase 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[] + setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "MineStrike" + C.cGray + "Team Survival", new String[] { ChatColor.RESET + "", ChatColor.RESET + "One team must defend two bomb sites from", diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 832053604..1d6947f06 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -36,7 +35,6 @@ import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.hanging.HangingBreakEvent; import org.bukkit.event.hanging.HangingPlaceEvent; -import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.world.WorldLoadEvent; @@ -54,8 +52,8 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTabTitle; -import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTextMiddle; +import mineplex.core.common.util.UtilTime; import mineplex.core.disguise.disguises.DisguisePlayer; import mineplex.core.itemstack.ItemBuilder; import mineplex.core.packethandler.IPacketHandler; @@ -72,18 +70,24 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.PlayerGameRespawnEvent; import nautilus.game.arcade.events.PlayerStateChangeEvent; import nautilus.game.arcade.game.GameTeam.PlayerState; -import nautilus.game.arcade.gametutorial.GameTutorial; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.KitAvailability; import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.managers.GameLobbyManager; import nautilus.game.arcade.scoreboard.GameScoreboard; -import nautilus.game.arcade.stats.*; +import nautilus.game.arcade.stats.AssistsStatTracker; +import nautilus.game.arcade.stats.DamageDealtStatTracker; +import nautilus.game.arcade.stats.DamageTakenStatTracker; +import nautilus.game.arcade.stats.DeathsStatTracker; +import nautilus.game.arcade.stats.ExperienceStatTracker; +import nautilus.game.arcade.stats.GamesPlayedStatTracker; +import nautilus.game.arcade.stats.KillsStatTracker; +import nautilus.game.arcade.stats.LoseStatTracker; +import nautilus.game.arcade.stats.StatTracker; +import nautilus.game.arcade.stats.WinStatTracker; import nautilus.game.arcade.world.WorldData; import net.minecraft.server.v1_8_R3.EntityItem; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; -import net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardTeam; -import net.minecraft.server.v1_8_R3.ScoreboardTeam; import net.minecraft.server.v1_8_R3.WorldServer; public abstract class Game implements Listener @@ -124,6 +128,7 @@ public abstract class Game implements Listener private boolean _countdownForce = false; private String _customWinLine = ""; + private NautHashMap _customWinMessages = new NautHashMap(); // Kits private Kit[] _kits; @@ -492,6 +497,11 @@ public abstract class Game implements Listener { _customWinLine = line; } + + public void SetCustomWinMessage(Player player, String message) + { + _customWinMessages.put(player, message); + } public GameScoreboard GetScoreboard() { @@ -1156,7 +1166,20 @@ public abstract class Game implements Listener UtilPlayer.message(player, "Nobody won the game!"); } - UtilPlayer.message(player, _customWinLine); + if (_customWinMessages.containsKey(player)) + { + if (!_customWinLine.trim().equalsIgnoreCase("")) + { + UtilPlayer.message(player, _customWinLine); + } + + UtilPlayer.message(player, _customWinMessages.get(player)); + } + else + { + UtilPlayer.message(player, _customWinLine); + } + UtilPlayer.message(player, ""); UtilPlayer.message(player, "§aMap - §f§l" + WorldData.MapName + C.cGray + " created by " + "§f§l" + WorldData.MapAuthor); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java index 7384a3cc6..3d5ca5cf0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/SoloGame.java @@ -1,8 +1,9 @@ package nautilus.game.arcade.game; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -13,8 +14,6 @@ import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.events.PlayerStateChangeEvent; -import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.kit.Kit; public abstract class SoloGame extends Game @@ -36,6 +35,11 @@ public abstract class SoloGame extends Game _players.SetColor(ChatColor.YELLOW); _players.SetName("Players"); } + + public GameTeam getPlayersTeam() + { + return _players; + } @Override public void EndCheck() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index a508ff1cd..ebe29c61b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.game.games.christmas; -import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; @@ -8,9 +7,8 @@ import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; -import org.bukkit.craftbukkit.v1_8_R3.CraftServer; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; -import org.bukkit.entity.EntityType; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHorse; import org.bukkit.entity.Player; import org.bukkit.entity.Villager; import org.bukkit.event.EventHandler; @@ -18,13 +16,16 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.HandlerList; import org.bukkit.event.block.BlockFadeEvent; import org.bukkit.event.entity.EntityCombustEvent; -import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.util.Vector; import mineplex.core.common.util.C; +import mineplex.core.common.util.Callback; +import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilMath; @@ -34,7 +35,6 @@ import mineplex.core.common.util.UtilTime; import mineplex.core.packethandler.IPacketHandler; import mineplex.core.packethandler.PacketInfo; import mineplex.core.recharge.Recharge; -import mineplex.core.reward.rewards.PetReward; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -45,14 +45,22 @@ import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.games.christmas.kits.KitPlayer; -import nautilus.game.arcade.game.games.christmas.parts.*; +import nautilus.game.arcade.game.games.christmas.parts.Part; +import nautilus.game.arcade.game.games.christmas.parts.Part1; +import nautilus.game.arcade.game.games.christmas.parts.Part2; +import nautilus.game.arcade.game.games.christmas.parts.Part3; +import nautilus.game.arcade.game.games.christmas.parts.Part4; +import nautilus.game.arcade.game.games.christmas.parts.Part5; import nautilus.game.arcade.kit.Kit; +import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity; import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy; import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; public class Christmas extends SoloGame { + private GameTeam _badGuys; + private Sleigh _sleigh; private Location _sleighSpawn; @@ -201,7 +209,7 @@ public class Christmas extends SoloGame for (Location loc : WorldData.GetCustomLocs("129")) { _barrier.add(loc.getBlock().getLocation()); - MapUtil.QuickChangeBlockAt(loc, 65, (byte)3); + MapUtil.QuickChangeBlockAt(loc, 166, (byte)0); } //Parts @@ -250,7 +258,8 @@ public class Christmas extends SoloGame if (event.GetState() != GameState.Live) return; - GetTeamList().add(new GameTeam(this, "Christmas Thieves", ChatColor.RED, WorldData.GetDataLocs("RED"))); + _badGuys = new GameTeam(this, "Christmas Thieves", ChatColor.RED, WorldData.GetDataLocs("RED")); + AddTeam(_badGuys); } @EventHandler @@ -366,7 +375,7 @@ public class Christmas extends SoloGame for (Location loc : _barrier) { - if (UtilMath.offset(GetSleigh().GetLocation(), loc) > 15) + if (UtilMath.offset(GetSleigh().GetLocation(), loc) > 20) continue; breakAt = loc; @@ -458,14 +467,39 @@ public class Christmas extends SoloGame for (Player player : GetPlayers(false)) { - Manager.rewardPet(player, "Christmas Elf", EntityType.VILLAGER); + if (Manager.IsRewardItems()) + { + if (Manager.GetTaskManager().hasCompletedTask(player, "CC Reward 2015")) + { + SetCustomWinMessage(player, "You already earned your reward"); + } + else + { + SetCustomWinMessage(player, "You earned " + C.cYellow + "Winter Chest x2"); + + Manager.GetTaskManager().completedTask(new Callback() + { + @Override + public void run(Boolean data) + { + if (data) + { + Manager.getInventoryManager().addItemToInventory(player, "Winter Chest", 2); + } + else + { + UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "Winter Chest x2" + C.cGray + ".")); + } + } + }, player, "CC Reward 2015"); + } + } Manager.GetGame().AddGems(player, 30, "Slaying the Pumpkin King", false, false); Manager.GetGame().AddGems(player, 10, "Participation", false, false); } - SetCustomWinLine("You earned Christmas Elf Pet!"); - AnnounceEnd(this.GetTeamList().get(0)); + AnnounceEnd(getPlayersTeam()); SetState(GameState.End); } else if (GetPlayers(true).size() == 0) @@ -476,7 +510,7 @@ public class Christmas extends SoloGame } SetCustomWinLine("You all died..."); - AnnounceEnd(this.GetTeamList().get(1)); + AnnounceEnd(_badGuys); SetState(GameState.End); } else if (UtilTime.elapsed(GetStateTime(), _gameTime)) @@ -487,7 +521,7 @@ public class Christmas extends SoloGame } SetCustomWinLine("You did not save Christmas in time."); - AnnounceEnd(this.GetTeamList().get(1)); + AnnounceEnd(_badGuys); SetState(GameState.End); } @@ -504,7 +538,7 @@ public class Christmas extends SoloGame } SetCustomWinLine("Santa Claus was killed by the Giant!"); - AnnounceEnd(this.GetTeamList().get(1)); + AnnounceEnd(_badGuys); SetState(GameState.End); } @@ -572,30 +606,55 @@ public class Christmas extends SoloGame return; if (!IsLive()) + { + Scoreboard.Reset(); + + String line = ""; + for (int i = 0 ; i < 10 ; i++) + line += ((i % 2 == 0 ? C.cRed : C.cDGreen) + "█"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(line); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cWhiteB + "May your winter"); + Scoreboard.Write(C.cWhiteB + "be filled with " + C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); + + Scoreboard.WriteBlank(); + + Scoreboard.Write(C.cWhite + "Happy Holidays!"); + Scoreboard.Write(C.cWhiteB + "- Your friends at " + C.cGoldB + "MINEPLEX"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(line); + + Scoreboard.Draw(); return; + } //Wipe Last Scoreboard.Reset(); //Rounds Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Challenge:"); - Scoreboard.Write(C.cYellow + (5 - _parts.size()) + " of " + 5); + Scoreboard.Write(C.cGoldB + "Challenge"); + Scoreboard.Write(C.cWhite + (5 - _parts.size()) + " of " + 5); //Presents Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Presents:"); - Scoreboard.Write(C.cYellow + GetSleigh().GetPresents().size() + " of " + 10); + Scoreboard.Write(C.cGreenB + "Presents"); + Scoreboard.Write(C.cWhite + GetSleigh().GetPresents().size() + " of " + 10); //Players Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Players:"); - Scoreboard.Write(C.cYellow + GetPlayers(true).size()); + Scoreboard.Write(C.cYellowB + "Players"); + Scoreboard.Write(C.cWhite + GetPlayers(true).size()); //Time Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Time Left:"); - Scoreboard.Write(C.cYellow + UtilTime.MakeStr(_gameTime - (System.currentTimeMillis() - GetStateTime()))); + Scoreboard.Write(C.cYellowB + "Time Left"); + Scoreboard.Write(C.cWhite + UtilTime.MakeStr(_gameTime - (System.currentTimeMillis() - GetStateTime()))); Scoreboard.Draw(); } @@ -679,4 +738,37 @@ public class Christmas extends SoloGame UtilPlayer.sendPacket(player, packet); } } + + @EventHandler + public void updateReigns(UpdateEvent event) + { + if (!InProgress()) + return; + + if (event.getType() != UpdateType.FASTER) + return; + + if (_sleigh == null) + return; + + if (_sleigh.getSanta() == null) + return; + + for (SleighHorse horse : _sleigh.getHorses()) + { + if (horse.Ent == null || !horse.Ent.isValid()) + continue; + + PacketPlayOutAttachEntity packet = new PacketPlayOutAttachEntity(1, ((CraftHorse) horse.Ent).getHandle(), (((CraftEntity) _sleigh.getSanta()).getHandle())); + + for (Player player : UtilServer.getPlayers()) + UtilPlayer.sendPacket(player, packet); + } + } + + @EventHandler + public void preventStand(PlayerInteractAtEntityEvent event) + { + event.setCancelled(true); + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java index c4c5e0950..a41031b6c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java @@ -2,30 +2,28 @@ package nautilus.game.arcade.game.games.christmas; import java.util.ArrayList; +import org.bukkit.ChatColor; +import org.bukkit.Color; +import org.bukkit.Effect; +import org.bukkit.FireworkEffect; +import org.bukkit.FireworkEffect.Type; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Chicken; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.util.Vector; + import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilFirework; -import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.recharge.Recharge; import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.game.games.christmas.parts.Part; - -import org.bukkit.ChatColor; -import org.bukkit.Color; -import org.bukkit.Effect; -import org.bukkit.FireworkEffect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.FireworkEffect.Type; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Chicken; -import org.bukkit.entity.Entity; -import org.bukkit.entity.FallingBlock; -import org.bukkit.entity.Player; -import org.bukkit.util.Vector; public class Sleigh { @@ -41,6 +39,8 @@ public class Sleigh private ArrayList PresentsCollected = new ArrayList();; private Location Target; + + private Entity Santa; public void setupSleigh(Christmas host, Location loc) { @@ -52,24 +52,25 @@ public class Sleigh CentralEntity = loc.getWorld().spawn(loc, Chicken.class); UtilEnt.Vegetate(CentralEntity, true); - UtilEnt.ghost(CentralEntity, true, true); + UtilEnt.ghost(CentralEntity, true, false); + Host.Manager.GetCondition().Factory().Invisible("Sleigh", (LivingEntity) CentralEntity, null, Double.MAX_VALUE, 3, false, false, true); //Presents PresentSlots = new ArrayList(); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), -1, -2)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 0, -2)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 1, -2)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), -1, -1)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 0, -1)); - PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 1, -1)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), -1, -2)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 0, -2)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 1, -2)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), -1, -1)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 0, -1)); + PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 1, -1)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), -1, -2)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 0, -2)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 1, -2)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), -1, -1)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 0, -1)); - PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 1, -1)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), -1, -2)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 0, -2)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 1, -2)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), -1, -1)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 0, -1)); + PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 1, -1)); //Sleigh SleighEnts = new ArrayList(); @@ -77,65 +78,71 @@ public class Sleigh for (SleighPart part : PresentSlots) SleighEnts.add(part); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, -3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, -2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, -2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, -2)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -2)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, -2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, -2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, -2)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -2)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, -1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, -1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, -1)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, -1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, -1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, -1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -1)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, 0)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 0)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, 1)); - SleighEnts.add(new SleighPart(0, 159, 15, loc.clone(), 0, 1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, 1)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, 1)); + SleighEnts.add(new SleighPart(this, 0, 159, 15, loc.clone(), 0, 1)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, 1)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 1)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -2, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, 2)); - SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 2, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -2, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, 2)); + SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 2, 2)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 3)); - SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, 3)); + SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 3)); //Santa - SleighPart santa = new SleighPart(3, 0, 0, loc.clone(), 0, 1); - santa.AddSanta(); + SleighPart santa = new SleighPart(this, 3, 0, 0, loc.clone(), 0, 1); + Santa = santa.AddSanta(); SleighEnts.add(santa); - SleighHorses.add(new SleighHorse(loc.clone(), -1.5, 8)); - SleighHorses.add(new SleighHorse(loc.clone(), 1.5, 8)); + SleighHorses.add(new SleighHorse(loc.clone(), "Dasher", -1.5, 8)); + SleighHorses.add(new SleighHorse(loc.clone(), "Dancer", 1.5, 8)); + + SleighHorses.add(new SleighHorse(loc.clone(), "Prancer", -1.5, 11)); + SleighHorses.add(new SleighHorse(loc.clone(), "Vixen", 1.5, 11)); + + SleighHorses.add(new SleighHorse(loc.clone(), "Comet", -1.5, 14)); + SleighHorses.add(new SleighHorse(loc.clone(), "Cupid", 1.5, 14)); - SleighHorses.add(new SleighHorse(loc.clone(), -1.5, 11)); - SleighHorses.add(new SleighHorse(loc.clone(), 1.5, 11)); + SleighHorses.add(new SleighHorse(loc.clone(), "Donner", -1.5, 17)); + SleighHorses.add(new SleighHorse(loc.clone(), "Blitzen", 1.5, 17)); for (SleighHorse horse : SleighHorses) horse.spawnHorse(); - for (SleighHorse horse : SleighHorses) - UtilEnt.Leash(horse.Ent, santa.GetTop(), false, false); +// for (SleighHorse horse : SleighHorses) +// UtilEnt.Leash(horse.Ent, santa.GetTop(), true, false); } public Location GetLocation() @@ -157,6 +164,8 @@ public class Sleigh Move(CentralEntity, Target, 1); + Santa.setTicksLived(1); + //Move Sleigh for (SleighPart part : SleighEnts) { @@ -184,24 +193,6 @@ public class Sleigh { for (Player player : Host.GetPlayers(true)) { - if (!Recharge.Instance.usable(player, "Sleigh Bump")) - continue; - - for (SleighPart part : SleighEnts) - if (UtilMath.offset(player, part.Ent) < 1) - { - UtilAction.velocity(player, UtilAlg.getTrajectory2d(CentralEntity, player), 0.4, true, 0.2, 0, 0, true); - Recharge.Instance.useForce(player, "Sleigh Bump", 400); - } - - - for (SleighHorse part : SleighHorses) - if (UtilMath.offset(player, part.Ent) < 1) - { - UtilAction.velocity(player, UtilAlg.getTrajectory2d(CentralEntity, player), 0.4, true, 0.2, 0, 0, true); - Recharge.Instance.useForce(player, "Sleigh Bump", 400); - } - if (player.getLocation().getZ() < CentralEntity.getLocation().getZ() - 24) { player.damage(1); @@ -211,6 +202,64 @@ public class Sleigh Recharge.Instance.useForce(player, "Sleigh Bump", 400); } } + + for (SleighPart part : SleighEnts) + { + for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) + { + boolean matches = false; + for (SleighPart cur : SleighEnts) + { + if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) + { + matches = true; + break; + } + } + + if (matches) + continue; + + if (ent instanceof Player) + { + if (!Recharge.Instance.usable((Player) ent, "Sleigh Bump")) + continue; + + Recharge.Instance.useForce((Player) ent, "Sleigh Bump", 400); + } + + UtilAction.velocity(ent, UtilAlg.getTrajectory2d(CentralEntity, ent), 0.4, true, 0.2, 0, 0, true); + } + } + + for (SleighHorse part : SleighHorses) + { + for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) + { + boolean matches = false; + for (SleighPart cur : SleighEnts) + { + if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) + { + matches = true; + break; + } + } + + if (matches) + continue; + + if (ent instanceof Player) + { + if (!Recharge.Instance.usable((Player) ent, "Sleigh Bump")) + continue; + + Recharge.Instance.useForce((Player) ent, "Sleigh Bump", 400); + } + + UtilAction.velocity(ent, UtilAlg.getTrajectory2d(CentralEntity, ent), 0.4, true, 0.2, 0, 0, true); + } + } } public boolean HasPresent(Location loc) @@ -222,6 +271,7 @@ public class Sleigh { PresentsCollected.add(loc); loc.getBlock().setType(Material.AIR); + loc.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.IRON_BLOCK); loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GLASS); UtilFirework.launchFirework(loc.clone().add(0.5, 0.5, 0.5), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BALL).trail(true).build(), new Vector(0,1,0), 0); @@ -267,4 +317,9 @@ public class Sleigh { return SleighHorses; } + + public Entity getSanta() + { + return Santa; + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java index 10a772184..0f0e5ed2f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighHorse.java @@ -2,6 +2,19 @@ package nautilus.game.arcade.game.games.christmas; import java.util.HashSet; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; +import org.bukkit.entity.Horse; +import org.bukkit.entity.Horse.Color; +import org.bukkit.entity.Horse.Style; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; + +import mineplex.core.common.util.C; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilPlayer; import net.minecraft.server.v1_8_R3.DataWatcher; @@ -14,19 +27,6 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving; import net.minecraft.server.v1_8_R3.Vector3f; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; -import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack; -import org.bukkit.entity.Horse; -import org.bukkit.entity.Player; -import org.bukkit.entity.Horse.Color; -import org.bukkit.entity.Horse.Style; -import org.bukkit.entity.LivingEntity; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - public class SleighHorse { private Location _lastFacing; @@ -40,9 +40,11 @@ public class SleighHorse public int horseId; public double OffsetX; public double OffsetZ; + public String Name; - public SleighHorse(Location loc, double x, double z) + public SleighHorse(Location loc, String name, double x, double z) { + Name = name; OffsetX = x; OffsetZ = z; _lastFacing = loc.add(x, 0.5, z); @@ -182,6 +184,10 @@ public class SleighHorse Ent = _lastFacing.getWorld().spawn(_lastFacing.subtract(0, 0.5, 0), Horse.class); UtilEnt.Vegetate(Ent); UtilEnt.ghost(Ent, true, false); + Ent.setRemoveWhenFarAway(false); + + Ent.setCustomName(C.cWhiteB + Name); + Ent.setCustomNameVisible(true); Ent.setStyle(Style.BLACK_DOTS); Ent.setColor(Color.BROWN); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java index 2c0406f27..877d36049 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/SleighPart.java @@ -1,9 +1,5 @@ package nautilus.game.arcade.game.games.christmas; -import mineplex.core.common.util.C; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; - import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Material; @@ -16,6 +12,10 @@ import org.bukkit.entity.Skeleton; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.LeatherArmorMeta; +import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; + public class SleighPart { public Chicken Ent; @@ -23,38 +23,32 @@ public class SleighPart public double OffsetX; public double OffsetZ; - public SleighPart(int rise, int id, int data, Location loc, double x, double z) + public int Rise; + public int Id; + public int Data; + public Location Location; + + public SleighPart(Sleigh sleigh, int rise, int id, int data, Location loc, double x, double z) { //Base Ent = loc.getWorld().spawn(loc.add(x, 0, z), Chicken.class); Ent.setBaby(); Ent.setAgeLock(true); + Ent.setRemoveWhenFarAway(false); + UtilEnt.Vegetate(Ent, true); - UtilEnt.ghost(Ent, true, true); - + UtilEnt.ghost(Ent, true, false); + sleigh.Host.Manager.GetCondition().Factory().Invisible("Sleigh", Ent, null, Double.MAX_VALUE, 3, false, false, true); + //Height - Chicken top = Ent; - for (int i=0 ; i _heightComparator = new Comparator() + { + @Override + public int compare(Block o1, Block o2) + { + if (o1.getLocation().getBlockY() == o2.getLocation().getBlockY()) + return 0; + + return o1.getLocation().getBlockY() > o2.getLocation().getBlockY() ? 1 : -1; + } + }; + public IceMaze(Christmas host, ArrayList mazeCorners, ArrayList mazeExits, Location[] presents) { Host = host; @@ -71,6 +84,8 @@ public class IceMaze if (_blocks.isEmpty()) return; + Collections.sort(_blocks, _heightComparator); + for (int i=0 ; i<20 ; i++) { if (_blocks.isEmpty()) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java index cae20e196..b97da2215 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java @@ -1,17 +1,15 @@ package nautilus.game.arcade.game.games.christmas.content; import java.util.ArrayList; +import java.util.List; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; -import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; import org.bukkit.entity.IronGolem; import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.IronGolem; import org.bukkit.entity.Player; -import org.bukkit.entity.Slime; import org.bukkit.entity.Snowball; import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -147,7 +145,17 @@ public class SnowmanBoss else { if ((minion.Target == null || !minion.Target.isValid() || !Host.IsAlive(minion.Target)) && !Host.GetPlayers(true).isEmpty()) - minion.Target = UtilAlg.Random(Host.GetPlayers(true)); + { + List valid = new ArrayList(); + for (Player player : Host.GetPlayers(true)) + if (UtilMath.offset(player, minion.Ent) <= 25 && player.getLocation().getBlockY() >= minion.Ent.getLocation().getBlockY()) + valid.add(player); + + minion.Target = UtilAlg.Random(valid); + } + + if (minion.Target == null) + continue; //Move UtilEnt.CreatureMoveFast(minion.Ent, minion.Target.getLocation(), 1.6f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java index 5aeecaa3b..140bcb805 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java @@ -6,17 +6,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilWorld; -import mineplex.core.recharge.Recharge; -import nautilus.game.arcade.game.games.christmas.Christmas; - import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; @@ -28,6 +17,16 @@ import org.bukkit.entity.Snowman; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.util.Vector; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.game.games.christmas.Christmas; +import nautilus.game.arcade.game.games.christmas.content.SnowmanWaypoint.CardinalDirection; + public class SnowmanMaze { private Christmas Host; @@ -163,48 +162,90 @@ public class SnowmanMaze if (south != null) nextBlock.add(south); if (east != null) nextBlock.add(east); if (west != null) nextBlock.add(west); - - //Random Direction - if (!nextBlock.isEmpty()) + + if(nextBlock.isEmpty()) { - data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5); - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + entIterator.remove(); + data.getKey().remove(); + continue; + } + + if(nextBlock.size() > 1 && data.getValue().Direction != CardinalDirection.NULL) // they can do a uturn if they're stuck + { + if(data.getValue().Direction == CardinalDirection.NORTH) + { + nextBlock.remove(south); + } + else if(data.getValue().Direction == CardinalDirection.SOUTH) + { + nextBlock.remove(north); + } + else if(data.getValue().Direction == CardinalDirection.WEST) + { + nextBlock.remove(east); + } + else if(data.getValue().Direction == CardinalDirection.EAST) + { + nextBlock.remove(west); + } + } + + if (nextBlock.isEmpty()) + { + entIterator.remove(); + data.getKey().remove(); + continue; + } + + //Random Direction + Location nextLoc = UtilAlg.Random(nextBlock).getLocation(); + data.getValue().Target = nextLoc.clone().add(0.5, 0, 0.5); + if(north != null && nextLoc.equals(north.getLocation())) + { + data.getValue().Direction = CardinalDirection.NORTH; + } + else if(south != null && nextLoc.equals(south.getLocation())) + { + data.getValue().Direction = CardinalDirection.SOUTH; + } + else if(east != null && nextLoc.equals(east.getLocation())) + { + data.getValue().Direction = CardinalDirection.EAST; + } + else if(west != null && nextLoc.equals(west.getLocation())) + { + data.getValue().Direction = CardinalDirection.WEST; } } - - //Timeout Move - if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1) - data.getValue().Time = System.currentTimeMillis(); - - if (UtilTime.elapsed(data.getValue().Time, 2000)) - UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f); + + UtilEnt.CreatureMoveFast(data.getKey(), data.getValue().Target, 1.4f); } } - + private Block getTarget(Block start, Block cur, BlockFace face) { if (cur == null) cur = start; - + while (_waypoints.contains(cur.getRelative(face))) { cur = cur.getRelative(face); - + //Stop at intersection int count = 0; - - if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; - if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; - if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; - if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; - + + if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH)) && !_waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; + if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH)) && !_waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; + if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST)) && !_waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; + if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST)) && !_waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; + if (count > 1) break; } - + if (cur.equals(start)) return null; - + return cur; } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java index 78e197277..22c0deabf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanWaypoint.java @@ -6,6 +6,7 @@ public class SnowmanWaypoint { public Location Last; public Location Target; + public CardinalDirection Direction = CardinalDirection.NULL; public long Time; public SnowmanWaypoint(Location last) @@ -14,4 +15,9 @@ public class SnowmanWaypoint Target = null; Time = System.currentTimeMillis(); } + + public static enum CardinalDirection + { + NORTH, SOUTH, EAST, WEST, NULL // such order much not care + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java index 9af09d62b..3c3efcee3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/kits/KitPlayer.java @@ -1,12 +1,15 @@ package nautilus.game.arcade.game.games.christmas.kits; +import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.C; +import mineplex.core.itemstack.ItemBuilder; import mineplex.core.itemstack.ItemStackFactory; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Kit; @@ -21,15 +24,23 @@ public class KitPlayer extends Kit new String[] { - "Help Santa retreive the lost presents!" + "Help Santa retrieve the lost presents!" }, new Perk[] { }, - EntityType.ZOMBIE, + EntityType.SKELETON, new ItemStack(Material.IRON_SWORD)); - + } + + @Override + public void SpawnCustom(LivingEntity ent) + { + ent.getEquipment().setHelmet(new ItemBuilder(Material.LEATHER_HELMET).setColor(Color.RED).setUnbreakable(true).build()); + ent.getEquipment().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(Color.RED).build()); + ent.getEquipment().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setColor(Color.RED).build()); + ent.getEquipment().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setColor(Color.BLACK).build()); } @Override @@ -43,7 +54,7 @@ public class KitPlayer extends Kit item = ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, C.cGreen + C.Bold + "Toy Bow"); item.addEnchantment(Enchantment.ARROW_INFINITE, 1); player.getInventory().setItem(1, item); - player.getInventory().setItem(28, ItemStackFactory.Instance.CreateStack(Material.ARROW)); + player.getInventory().setItem(9, ItemStackFactory.Instance.CreateStack(Material.ARROW)); //Axe item = ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE, (byte)0, 1, C.cGreen + C.Bold + "Coal Digger"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java index 7a96132c4..ea8e171cc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part.java @@ -1,35 +1,42 @@ package nautilus.game.arcade.game.games.christmas.parts; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.BlockFace; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; +import org.bukkit.entity.Ageable; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.Creature; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.HandlerList; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.event.player.PlayerInteractAtEntityEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.SkullMeta; + import mineplex.core.common.util.C; +import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextTop; +import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.game.games.christmas.Christmas; import nautilus.game.arcade.game.games.christmas.ChristmasAudio; import net.minecraft.server.v1_8_R3.EntityCreature; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.SkullType; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.Skull; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; -import org.bukkit.entity.Ageable; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.HandlerList; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerInteractEvent; - public abstract class Part implements Listener { public Christmas Host; @@ -42,6 +49,7 @@ public abstract class Part implements Listener protected double _objectiveHealth = 1; protected HashMap _creatures = new HashMap(); + protected NautHashMap _spawnedPresents = new NautHashMap(); public Part(Christmas host, Location sleigh, Location[] presents) { @@ -53,38 +61,63 @@ public abstract class Part implements Listener loc.getBlock().setType(Material.AIR); } + @SuppressWarnings("deprecation") public void Prepare() { Activate(); for (Location loc : _presents) - { - Block present = loc.getBlock(); - present.setTypeIdAndData(Material.SKULL.getId(), (byte)1, true); - - Skull skull = (Skull) present.getState(); - skull.setSkullType(SkullType.PLAYER); + { + Location standLoc = loc.clone().add(0, -1.45, 0); + standLoc.setYaw(UtilMath.r(100)); - //Present Type - double r = Math.random(); - if (r > 0.75) skull.setOwner("CruXXx"); - else if (r > 0.5) skull.setOwner("CruXXx"); - else if (r > 0.25) skull.setOwner("CruXXx"); - else skull.setOwner("CruXXx"); + Host.CreatureAllowOverride = true; + ArmorStand stand = loc.getWorld().spawn(standLoc, ArmorStand.class); + Host.CreatureAllowOverride = false; - //Angle - BlockFace face = BlockFace.UP; - while (face == BlockFace.UP || face == BlockFace.DOWN || face == BlockFace.SELF) - face = BlockFace.values()[UtilMath.r(BlockFace.values().length)]; - skull.setRotation(face); - - skull.update(); + stand.setVisible(false); + stand.setGravity(false); + + ItemStack stack = ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM, (byte) 3); + SkullMeta meta = (SkullMeta) stack.getItemMeta(); + meta.setOwner("CruXXx"); + stack.setItemMeta(meta); + + stand.setHelmet(stack); +// +// present.setTypeIdAndData(Material.SKULL.getId(), (byte)1, true); +// +// Skull skull = (Skull) present.getState(); +// skull.setSkullType(SkullType.PLAYER); +// +// //Present Type +// double r = Math.random(); +// if (r > 0.75) skull.setOwner("CruXXx"); +// else if (r > 0.5) skull.setOwner("CruXXx"); +// else if (r > 0.25) skull.setOwner("CruXXx"); +// else skull.setOwner("CruXXx"); +// +// //Angle +// BlockFace face = BlockFace.UP; +// while (face == BlockFace.UP || face == BlockFace.DOWN || face == BlockFace.SELF) +// face = BlockFace.values()[UtilMath.r(BlockFace.values().length)]; +// skull.setRotation(face); +// +// skull.update(); + + _spawnedPresents.put(stand, loc); //Beacon - present.getRelative(BlockFace.DOWN).setType(Material.BEACON); for (int x=-1 ; x<=1 ; x++) for (int z=-1 ; z<=1 ; z++) - present.getRelative(x, -2, z).setType(Material.IRON_BLOCK); + { + loc.getBlock().getRelative(x, -2, z).setType(Material.IRON_BLOCK); + loc.getBlock().getRelative(x, -3, z).setType(Material.IRON_BLOCK); + } + + loc.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.BEACON); + loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS); + loc.getBlock().getRelative(BlockFace.DOWN).setData(UtilMath.randomElement(new Byte[]{14, 5, 13})); } } @@ -157,35 +190,38 @@ public abstract class Part implements Listener return true; } - @EventHandler - public void PresentCollect(PlayerInteractEvent event) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = false) + public void PresentCollect(PlayerInteractAtEntityEvent event) { - if (event.getClickedBlock() == null) + Location present = _spawnedPresents.get(event.getRightClicked()); + if (present == null) return; - + boolean contains = false; for (Location loc : _presents) - if (loc.getBlock().equals(event.getClickedBlock())) + if (loc.getBlock().equals(present.getBlock())) contains = true; if (!contains) return; - event.setCancelled(true); - if (!Host.IsLive()) return; if (!Host.IsAlive(event.getPlayer())) return; - if (Host.GetSleigh().HasPresent(event.getClickedBlock().getLocation())) + if (Host.GetSleigh().HasPresent(present.getBlock().getLocation())) return; - if (UtilMath.offset(event.getPlayer().getLocation(), event.getClickedBlock().getLocation().add(0.5, 0.5, 0.5)) > 2) + if (UtilMath.offset(event.getPlayer().getLocation(), present.clone().add(0.5, 0.5, 0.5)) > 2) return; - Host.GetSleigh().AddPresent(event.getClickedBlock().getLocation()); + _spawnedPresents.remove(event.getRightClicked()); + + event.getRightClicked().remove(); + + Host.GetSleigh().AddPresent(present.getBlock().getLocation()); Host.SantaSay("Well done " + event.getPlayer().getName() + "! You collected a present!", null); } @@ -276,4 +312,21 @@ public abstract class Part implements Listener _creatures.clear(); } + @EventHandler + public void onDamagePresent(EntityDamageEvent event) + { + event.setCancelled(_spawnedPresents.containsKey(event.getEntity())); + } + + @EventHandler + public void PresentParticles(UpdateEvent event) + { + if (event.getType() != UpdateType.FAST) + return; + + for (Entity ent : _spawnedPresents.keySet()) + { + UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, ent.getLocation().clone().add(0, 1.5, 0), .3F, .3F, .3F, 0F, 1, ViewDist.LONG, UtilServer.getPlayers()); + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java index c37047bce..6839ff135 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part1.java @@ -1,41 +1,33 @@ package nautilus.game.arcade.game.games.christmas.parts; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.events.GameStateChangeEvent; -import nautilus.game.arcade.game.Game.GameState; -import nautilus.game.arcade.game.games.christmas.Christmas; -import nautilus.game.arcade.game.games.christmas.ChristmasAudio; - import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton; import org.bukkit.entity.TNTPrimed; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.inventory.ItemStack; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilServer; +import mineplex.core.common.util.UtilTime; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.game.games.christmas.Christmas; +import nautilus.game.arcade.game.games.christmas.ChristmasAudio; + public class Part1 extends Part { private ArrayList _skeletons; @@ -145,7 +137,7 @@ public class Part1 extends Part _presents = System.currentTimeMillis(); - Host.SantaSay("Theres some of the presents up ahead!", ChristmasAudio.P1_B); + Host.SantaSay("There are some of the presents up ahead!", ChristmasAudio.P1_B); SetObjectivePresents(); } @@ -189,7 +181,7 @@ public class Part1 extends Part } Host.SantaSay("Clear the path! Watch out for the undead!", ChristmasAudio.P1_D); - SetObjectiveText("Clear a path for Santas Sleigh!", 1); + SetObjectiveText("Clear a path for Santa's Sleigh!", 1); } private void UpdateClear() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java index 7286d1512..26b282b57 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part4.java @@ -3,10 +3,22 @@ package nautilus.game.arcade.game.games.christmas.parts; import java.util.ArrayList; import java.util.Iterator; +import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.Giant; +import org.bukkit.entity.Zombie; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.entity.EntityChangeBlockEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.ItemStack; + import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; import mineplex.core.hologram.Hologram; import mineplex.core.hologram.HologramManager; import mineplex.core.updater.UpdateType; @@ -17,24 +29,6 @@ import nautilus.game.arcade.game.games.christmas.ChristmasAudio; import nautilus.game.arcade.game.games.christmas.content.CaveGiant; import nautilus.game.arcade.game.games.christmas.content.Snake; -import org.bukkit.ChatColor; -import org.bukkit.Effect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.FallingBlock; -import org.bukkit.entity.Giant; -import org.bukkit.entity.Spider; -import org.bukkit.entity.Zombie; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.entity.EntityChangeBlockEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.ItemStack; - public class Part4 extends Part { private ArrayList _roofIce; @@ -51,6 +45,13 @@ public class Part4 extends Part private boolean _b = false; private HologramManager _holoManager; + private String[] _evilElfNames = new String[] + { "Bing", "Bling", "Blitz", "Larry", "Buddy", "Buster", "Cedar", "Dash", "Eggnog", "Elfie", "Elm", "Elvis", + "Evergreen", "Figgy", "Flake", "Frank", "Frost", "Gabriel", "George", "Henry", "Hermey", "Ice", "Jangle", + "Jingle", "Jinx", "Kringle", "Kris", "Louie", "Max", "Mistletoe", "Nat", "Nick", "Noel", "Pax", "Peppermin", + "Pine", "Ralphie", "Rudy", "Snow", "Snowball", "Star", "Tinsel", "Tiny", "Topper", "Trinket", "Wayne", + "Wink", "Yule", "Zippy" }; + public Part4(HologramManager holoManager, Christmas host, Location sleigh, Location[] presents, ArrayList roofIce, ArrayList mobs, ArrayList snakeHead, ArrayList snakeTrail, ArrayList gate, ArrayList checkpoints, Location giant) { @@ -85,7 +86,7 @@ public class Part4 extends Part @EventHandler public void GateUpdate(UpdateEvent event) { - if (event.getType() != UpdateType.SEC) + if (event.getType() != UpdateType.FAST) return; if (_gate.isEmpty()) @@ -187,6 +188,8 @@ public class Part4 extends Part ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS)); ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS)); ent.setVillager(true); + + ent.setCustomName("Evil Elf " + UtilMath.randomElement(_evilElfNames)); ent.setHealth(9); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java index 741b7f3ac..2dceaca60 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/parts/Part5.java @@ -2,41 +2,37 @@ package nautilus.game.arcade.game.games.christmas.parts; import java.util.ArrayList; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilAlg; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.game.games.christmas.Christmas; -import nautilus.game.arcade.game.games.christmas.ChristmasAudio; -import nautilus.game.arcade.game.games.christmas.content.*; -import net.minecraft.server.v1_8_R3.EntityCreature; - import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.EntityEffect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature; import org.bukkit.entity.Player; import org.bukkit.entity.Snowman; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.HandlerList; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockIgniteEvent; import org.bukkit.event.entity.EntityCombustEvent; -import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilTime; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.game.games.christmas.Christmas; +import nautilus.game.arcade.game.games.christmas.ChristmasAudio; +import nautilus.game.arcade.game.games.christmas.content.BossFloor; +import nautilus.game.arcade.game.games.christmas.content.BossMobs; +import nautilus.game.arcade.game.games.christmas.content.BossSnowmanPattern; +import nautilus.game.arcade.game.games.christmas.content.PumpkinKing; + public class Part5 extends Part { private ArrayList _spawn; @@ -385,6 +381,9 @@ public class Part5 extends Part @EventHandler public void Damage(CustomDamageEvent event) { + if (event.isCancelled()) + return; + if (_boss == null) return; From 0c383f8bf4858c4e3a32658f8d2b54e171b761eb Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 18:58:03 -0500 Subject: [PATCH 39/51] Remove bad message --- .../Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index cd1a4d1fd..86b7852ec 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import org.bukkit.ChatColor; -//Mysticate@184.154.0.242:7990/scm/min/mineplex.git import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; From 0e9e8c155f2f680cbded4a75eba11f57ee723626 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 19:11:06 -0500 Subject: [PATCH 40/51] Quick fix that I don't think i caused. --- .../Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 86b7852ec..6b1411ecd 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -248,7 +248,7 @@ public class ServerGameMenu extends ShopPageBase setItem(42, _minigameCycle.get(_minigameIndex)); 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[] + .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 ", From a827f95eb448564d925f861bb3d386db9ecf02c6 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 19:24:24 -0500 Subject: [PATCH 41/51] Fixed scoreboard. VIVA LA FIESTA --- .../game/arcade/game/games/christmas/Christmas.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index ebe29c61b..7def0ed30 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -610,7 +610,7 @@ public class Christmas extends SoloGame Scoreboard.Reset(); String line = ""; - for (int i = 0 ; i < 10 ; i++) + for (int i = 0 ; i < 20 ; i++) line += ((i % 2 == 0 ? C.cRed : C.cDGreen) + "█"); Scoreboard.WriteBlank(); @@ -619,12 +619,14 @@ public class Christmas extends SoloGame Scoreboard.WriteBlank(); Scoreboard.Write(C.cWhiteB + "May your winter"); - Scoreboard.Write(C.cWhiteB + "be filled with " + C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); + Scoreboard.Write(C.cWhiteB + "be filled with"); + Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); Scoreboard.WriteBlank(); - Scoreboard.Write(C.cWhite + "Happy Holidays!"); - Scoreboard.Write(C.cWhiteB + "- Your friends at " + C.cGoldB + "MINEPLEX"); + Scoreboard.Write(C.cAquaB + "Happy Holidays!"); + Scoreboard.Write(C.cWhiteB + "- Your friends at"); + Scoreboard.Write(C.cGoldB + "MINEPLEX"); Scoreboard.WriteBlank(); Scoreboard.Write(line); From 0dd7db27cd6196b22acdc2ed751efce63ecbfaf7 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 19:49:41 -0500 Subject: [PATCH 42/51] FIXED FORAMTTING --- .../nautilus/game/arcade/game/games/christmas/Christmas.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index 7def0ed30..d3644f231 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -620,11 +620,14 @@ public class Christmas extends SoloGame Scoreboard.Write(C.cWhiteB + "May your winter"); Scoreboard.Write(C.cWhiteB + "be filled with"); - Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer" + C.cWhiteB + "."); + Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer."); Scoreboard.WriteBlank(); Scoreboard.Write(C.cAquaB + "Happy Holidays!"); + + Scoreboard.WriteBlank(); + Scoreboard.Write(C.cWhiteB + "- Your friends at"); Scoreboard.Write(C.cGoldB + "MINEPLEX"); From b5bdf7ced4341d29116c6efdd91a7bc85b65fd91 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 14 Dec 2015 15:42:32 +1300 Subject: [PATCH 43/51] Remove custom name on players on join and arcade spectator --- .../src/mineplex/core/CustomTagFix.java | 22 ++++++++++++++----- .../nautilus/game/arcade/ArcadeManager.java | 3 +++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java index 790df2c43..d757499b7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java @@ -35,6 +35,8 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.event.player.PlayerVelocityEvent; @@ -81,6 +83,15 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook _loggedIn.remove(event.getPlayer()); } + @EventHandler(priority = EventPriority.LOW) + public void playerJoin(PlayerJoinEvent event) + { + Player player = event.getPlayer(); + + player.setCustomName(""); + player.setCustomNameVisible(false); + } + @EventHandler public void ncpExempt(final PlayerToggleFlightEvent event) { @@ -140,7 +151,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook { Entry> entry = iterator.next(); - for (Iterator> innerIterator = entry.getValue().entrySet().iterator(); innerIterator.hasNext();) + for (Iterator> innerIterator = entry.getValue().entrySet().iterator(); innerIterator + .hasNext();) { final Entry entry2 = innerIterator.next(); @@ -247,7 +259,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook _entityNameMap.get(owner.getName()).put(spawnPacket.a, entityName); _entityMap.get(owner.getName()).put(spawnPacket.a, new Integer[] { - newId + newId }); sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier, true, -1); @@ -349,7 +361,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook { newId = new Integer[] { - UtilEnt.getNewEntityId() + UtilEnt.getNewEntityId() }; _entityMap.get(owner.getName()).put(metaPacket.a, newId); @@ -469,8 +481,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook _entityRiding.get(owner.getName()).remove(attachPacket.b); - sendProtocolPackets(owner, vehicleId, ids[ids.length - 1], - _entityNameMap.get(owner.getName()).get(vehicleId), verifier, true, ids.length > 1 ? ids[0] : -1); + sendProtocolPackets(owner, vehicleId, ids[ids.length - 1], _entityNameMap.get(owner.getName()).get(vehicleId), + verifier, true, ids.length > 1 ? ids[0] : -1); } else { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index fbf22d621..016289a6f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -921,6 +921,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation ((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0)); + player.setCustomName(""); + player.setCustomNameVisible(false); + player.setSprinting(false); player.setSneaking(false); From a04eaddc427553f97bb159e35970e76c3e4664c0 Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 22:25:18 -0500 Subject: [PATCH 44/51] Fixed bump --- .../arcade/game/games/christmas/Sleigh.java | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java index a41031b6c..26ef62540 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Sleigh.java @@ -207,17 +207,7 @@ public class Sleigh { for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) { - boolean matches = false; - for (SleighPart cur : SleighEnts) - { - if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) - { - matches = true; - break; - } - } - - if (matches) + if (isPart(ent)) continue; if (ent instanceof Player) @@ -236,17 +226,7 @@ public class Sleigh { for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet()) { - boolean matches = false; - for (SleighPart cur : SleighEnts) - { - if (ent instanceof LivingEntity && cur.HasEntity((LivingEntity) ent)) - { - matches = true; - break; - } - } - - if (matches) + if (isPart(ent)) continue; if (ent instanceof Player) @@ -322,4 +302,30 @@ public class Sleigh { return Santa; } + + public boolean isPart(Entity ent) + { + if (ent == null) + return false; + + if (ent == CentralEntity) + return true; + + if (ent == Santa) + return true; + + for (SleighPart part : SleighEnts) + if (part.Block == ent || part.Ent == ent || (ent instanceof LivingEntity && part.HasEntity((LivingEntity) ent))) + return true; + + for (SleighHorse horse : SleighHorses) + if (horse.Ent == ent || (ent instanceof LivingEntity && horse.HasEntity((LivingEntity) ent))) + return true; + + for (SleighPart part : PresentSlots) + if (part.Block == ent || part.Ent == ent || (ent instanceof LivingEntity && part.HasEntity((LivingEntity) ent))) + return true; + + return false; + } } From 42244ae79876e2075ddeeccb057c26116e7a922f Mon Sep 17 00:00:00 2001 From: Mysticate Date: Sun, 13 Dec 2015 22:43:11 -0500 Subject: [PATCH 45/51] Snowman AI fix --- .../arcade/game/games/christmas/content/SnowmanMaze.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java index 140bcb805..a9d5d3767 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java @@ -234,10 +234,10 @@ public class SnowmanMaze //Stop at intersection int count = 0; - if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH)) && !_waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; - if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH)) && !_waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; - if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST)) && !_waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; - if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST)) && !_waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; + if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++; + if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++; + if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++; + if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++; if (count > 1) break; From dcf3c1ea8840475263b53f4a8391f67500685868 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sun, 13 Dec 2015 23:14:17 -0500 Subject: [PATCH 46/51] Deleted and added new Cache since renaming was jacked up. --- Plugins/BuildFiles/common.xml | 10 +++++----- .../.classpath | 0 .../.project | 0 .../src/mineplex/cache/player/PlayerCache.java | 0 .../src/mineplex/cache/player/PlayerInfo.java | 0 .../Mineplex.PlayerCache/Mineplex.PlayerCache.iml | 12 ------------ 6 files changed, 5 insertions(+), 17 deletions(-) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/.classpath (100%) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/.project (100%) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/src/mineplex/cache/player/PlayerCache.java (100%) rename Plugins/{Mineplex.PlayerCache => Mineplex.Cache}/src/mineplex/cache/player/PlayerInfo.java (100%) delete mode 100644 Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml diff --git a/Plugins/BuildFiles/common.xml b/Plugins/BuildFiles/common.xml index 4200a7c8a..7cbbd04a4 100644 --- a/Plugins/BuildFiles/common.xml +++ b/Plugins/BuildFiles/common.xml @@ -86,7 +86,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -249,7 +249,7 @@ - + @@ -329,7 +329,7 @@ - + diff --git a/Plugins/Mineplex.PlayerCache/.classpath b/Plugins/Mineplex.Cache/.classpath similarity index 100% rename from Plugins/Mineplex.PlayerCache/.classpath rename to Plugins/Mineplex.Cache/.classpath diff --git a/Plugins/Mineplex.PlayerCache/.project b/Plugins/Mineplex.Cache/.project similarity index 100% rename from Plugins/Mineplex.PlayerCache/.project rename to Plugins/Mineplex.Cache/.project diff --git a/Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerCache.java b/Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerCache.java similarity index 100% rename from Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerCache.java rename to Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerCache.java diff --git a/Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerInfo.java b/Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerInfo.java similarity index 100% rename from Plugins/Mineplex.PlayerCache/src/mineplex/cache/player/PlayerInfo.java rename to Plugins/Mineplex.Cache/src/mineplex/cache/player/PlayerInfo.java diff --git a/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml b/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml deleted file mode 100644 index 54892e832..000000000 --- a/Plugins/Mineplex.PlayerCache/Mineplex.PlayerCache.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file From c34ac3ec523a993bb9f6bcc801ad0c4ff2005fbc Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 14 Dec 2015 15:21:43 +1100 Subject: [PATCH 47/51] xmas --- .../nautilus/game/arcade/game/games/christmas/Christmas.java | 2 +- .../game/arcade/game/games/christmas/content/SnowmanBoss.java | 4 ++-- .../game/arcade/game/games/christmas/content/SnowmanMaze.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index d3644f231..226fbcb51 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -475,7 +475,7 @@ public class Christmas extends SoloGame } else { - SetCustomWinMessage(player, "You earned " + C.cYellow + "Winter Chest x2"); + SetCustomWinMessage(player, "You earned " + C.cYellow + "2x Winter Holiday Treasure"); Manager.GetTaskManager().completedTask(new Callback() { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java index b97da2215..82b334134 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanBoss.java @@ -49,8 +49,8 @@ public class SnowmanBoss _minions.add(new SnowmanMinion(_spawn.getWorld().spawn(_spawn, Snowman.class))); _heart = _spawn.getWorld().spawn(_spawn, IronGolem.class); - _heart.setMaxHealth(1000); - _heart.setHealth(1000); + _heart.setMaxHealth(1400); + _heart.setHealth(1400); UtilEnt.Vegetate(_heart); Host.CreatureAllowOverride = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java index a9d5d3767..e65212177 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/SnowmanMaze.java @@ -254,7 +254,7 @@ public class SnowmanMaze //Spawn if (!Host.GetSleigh().HasPresent(_present)) { - while (_ents.size() < 36) + while (_ents.size() < 44) { Location loc = UtilAlg.Random(_spawns); From 94169a5b8a16b364d2386a597866ceed6c68d4fd Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 14 Dec 2015 15:29:34 +1100 Subject: [PATCH 48/51] it made me push it :( --- Plugins/Mineplex.PlayerCache/.project | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Plugins/Mineplex.PlayerCache/.project diff --git a/Plugins/Mineplex.PlayerCache/.project b/Plugins/Mineplex.PlayerCache/.project new file mode 100644 index 000000000..5321c2157 --- /dev/null +++ b/Plugins/Mineplex.PlayerCache/.project @@ -0,0 +1,17 @@ + + + Mineplex.Cache + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + From fe3431ba0436834ced9353389f23ece576af3714 Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Sun, 13 Dec 2015 23:31:21 -0500 Subject: [PATCH 49/51] Cosmetic Menu Update --- .../mineplex/core/common/CurrencyType.java | 8 +- .../mineplex/core/cosmetic/ui/page/Menu.java | 280 +++++++++++------- .../core/shop/page/ConfirmationPage.java | 2 +- .../mineplex/core/treasure/TreasureType.java | 8 +- 4 files changed, 190 insertions(+), 108 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/CurrencyType.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/CurrencyType.java index 6a007fefa..e54f9f28f 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/CurrencyType.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/CurrencyType.java @@ -4,10 +4,10 @@ import org.bukkit.Material; public enum CurrencyType { - Tokens(" Tokens", Material.EMERALD), - Coins(" Coins", Material.DOUBLE_PLANT), - Gems(" Gems", Material.EMERALD), - Gold(" Gold", Material.GOLD_NUGGET); + Tokens("Tokens", Material.EMERALD), + Coins("Treasure Shards", Material.PRISMARINE_SHARD), + Gems("Gems", Material.EMERALD), + Gold("Gold", Material.GOLD_NUGGET); private String _prefix; private Material _displayMaterial; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java index e29d110ca..b191a0d93 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java @@ -1,5 +1,8 @@ package mineplex.core.cosmetic.ui.page; +import java.util.EnumMap; +import java.util.List; + import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Creature; @@ -11,6 +14,9 @@ import mineplex.core.account.CoreClientManager; import mineplex.core.common.CurrencyType; import mineplex.core.common.util.C; import mineplex.core.common.util.F; +import mineplex.core.common.util.LineFormat; +import mineplex.core.common.util.UtilText; +import mineplex.core.common.util.UtilUI; import mineplex.core.cosmetic.CosmeticManager; import mineplex.core.cosmetic.ui.CosmeticShop; import mineplex.core.cosmetic.ui.button.OpenArrowTrails; @@ -29,6 +35,7 @@ import mineplex.core.donation.Donor; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; import mineplex.core.mount.Mount; +import mineplex.core.pet.Pet; import mineplex.core.shop.item.IButton; import mineplex.core.shop.item.ShopItem; import mineplex.core.shop.page.ConfirmationPage; @@ -53,114 +60,189 @@ public class Menu extends ShopPageBase // " " // }, 1, false)); - addButton(1, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this)); - addButton(3, new ShopItem(Material.ARROW, "Arrow Trails", 1, false), new OpenArrowTrails(this)); - addButton(5, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", 1, false), new OpenDoubleJump(this)); - addButton(7, new ShopItem(Material.SKULL_ITEM, "Death Animations", 1, false), new OpenDeathAnimations(this)); - - addButton(19, new ShopItem(Material.MELON_BLOCK, "Gadgets", 1, false), new OpenGadgets(this)); - addButton(21, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this)); - addButton(23, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this)); - addButton(25, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this)); - - addButton(37, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this)); - addButton(39, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this)); - addButton(41, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this)); - addButton(43, new ShopItem(Material.NAME_TAG, "Taunts", new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false), new IButton() + int[] slots = UtilUI.getIndicesFor(12, 1); + int particleSlot = slots[0]; + int arrowSlot = slots[1]; + int jumpSlot = slots[2]; + int deathSlot = slots[3]; + int gadgetSlot = slots[4]; + int morphSlot = slots[5]; + int mountSlot = slots[6]; + int petSlot = slots[7]; + int hatSlot = slots[8]; + int costumeSlot = slots[9]; + int musicSlot = slots[10]; + int tauntSlot = slots[11]; + + EnumMap ownedCount = new EnumMap(GadgetType.class); + EnumMap maxCount = new EnumMap(GadgetType.class); + EnumMap enabled = new EnumMap(GadgetType.class); + + for(GadgetType type : GadgetType.values()) + { + ownedCount.put(type, 0); + maxCount.put(type, 0); + + List gadgets = getPlugin().getGadgetManager().getGadgets(type); + if (gadgets != null) + { + for (Gadget gadget : gadgets) + { + if (gadget.ownsGadget(getPlayer())) + { + ownedCount.put(type, ownedCount.get(type) + 1); + } + + maxCount.put(type, maxCount.get(type) + 1); + } + } + + final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), type); + if(gadget != null) enabled.put(type, gadget); + +// addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[0], 1, false, false), +// new IButton() +// { +// public void onClick(Player player, ClickType clickType) { +// playAcceptSound(player); +// gadget.Disable(player); +// refresh(); +// }; +// }); + } + + int mountOwned = 0; + int mountMax = 0; + Mount mountActive = getPlugin().getMountManager().getActive(getPlayer()); + for (Mount mount : getPlugin().getMountManager().getMounts()) + { + if (mount.HasMount(getPlayer())) + { + mountOwned++; + } + + mountMax++; + } + + int petOwned = 0; + int petMax = 0; + for (Pet pet : getPlugin().getPetManager().GetFactory().GetPets()) + { + if (getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType())) + { + petOwned++; + } + + petMax++; + } + Creature petActive = getPlugin().getPetManager().GetPet(getPlayer()); + + GadgetType type = GadgetType.Particle; + String[] lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(particleSlot, new ShopItem(Material.NETHER_STAR, "Particle Effects", lore, 1, false), new OpenParticles(this)); + if (enabled.containsKey(type)) addGlow(particleSlot); + + type = GadgetType.ArrowTrail; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(arrowSlot, new ShopItem(Material.ARROW, "Arrow Trails", lore, 1, false), new OpenArrowTrails(this)); + if (enabled.containsKey(type)) addGlow(arrowSlot); + + type = GadgetType.DoubleJump; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(jumpSlot, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", lore, 1, false), new OpenDoubleJump(this)); + if (enabled.containsKey(type)) addGlow(jumpSlot); + + type = GadgetType.Death; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(deathSlot, new ShopItem(Material.SKULL_ITEM, "Death Animations", lore, 1, false), new OpenDeathAnimations(this)); + if (enabled.containsKey(type)) addGlow(deathSlot); + + type = GadgetType.Item; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(gadgetSlot, new ShopItem(Material.MELON_BLOCK, "Gadgets", lore, 1, false), new OpenGadgets(this)); + if (enabled.containsKey(type)) addGlow(gadgetSlot); + + type = GadgetType.Morph; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(morphSlot, new ShopItem(Material.LEATHER, "Morphs", lore, 1, false), new OpenMorphs(this)); + if (enabled.containsKey(type)) addGlow(morphSlot); + + lore = getLore(mountOwned, mountMax, mountActive == null ? null : mountActive.GetName()); + addButton(mountSlot, new ShopItem(Material.IRON_BARDING, "Mounts", lore, 1, false), new OpenMounts(this)); + if (mountActive != null) addGlow(mountSlot); + + lore = getLore(petOwned, petMax, petActive == null ? null : petActive.getCustomName()); + addButton(petSlot, new ShopItem(Material.BONE, "Pets", lore, 1, false), new OpenPets(this)); + if (petActive != null) addGlow(petSlot); + + type = GadgetType.Hat; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(hatSlot, new ShopItem(Material.GOLD_HELMET, "Hats", lore, 1, false), new OpenHats(this)); + if (enabled.containsKey(type)) addGlow(hatSlot); + + type = GadgetType.Costume; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(costumeSlot, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", lore, 1, false), new OpenCostumes(this)); + if (enabled.containsKey(type)) addGlow(costumeSlot); + + type = GadgetType.MusicDisc; + lore = getLore(ownedCount.get(type), maxCount.get(type), enabled.get(type)); + addButton(musicSlot, new ShopItem(Material.GREEN_RECORD, "Music", lore, 1, false), new OpenMusic(this)); + if (enabled.containsKey(type)) addGlow(musicSlot); + + addButton(tauntSlot, new ShopItem(Material.NAME_TAG, "Taunts", new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false), new IButton() { @Override public void onClick(Player player, ClickType clickType) { - player.sendMessage(F.main("Shop", "Comming soon!")); + player.sendMessage(F.main("Shop", "Coming soon!")); } }); - - for(GadgetType type : GadgetType.values()) + +// if (getPlugin().getPetManager().hasActivePet(getPlayer().getName())) +// { +// Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName()); +// String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName(); +// addButton(25 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false), +// new IButton() +// { +// public void onClick(Player player, ClickType clickType) +// { +// playAcceptSound(player); +// getPlugin().getPetManager().RemovePet(player, true); +// refresh(); +// } +// }); +// } + } + + private String[] getLore(int ownedCount, int maxCount, Gadget enabled) + { + return getLore(ownedCount, maxCount, enabled == null ? null : enabled.GetName()); + } + + private String[] getLore(int ownedCount, int maxCount, String enabled) + { + if (enabled != null) { - final Gadget gadget = getPlugin().getGadgetManager().getActive(getPlayer(), type); - if(gadget == null) continue; - - int slot = 10; - switch (type) - { - case Particle: - slot = 1; - break; - case ArrowTrail: - slot = 3; - break; - case DoubleJump: - slot = 5; - break; - case Death: - slot = 7; - break; - case Item: - slot = 19; - break; - case Morph: - slot = 21; - break; - case Hat: - slot = 37; - break; - case Costume: - slot = 39; - break; - case MusicDisc: - slot = 41; - break; - case Taunt: - slot = 43; - break; - default: - slot = 1; - break; - } - slot += 9; - - addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), C.mItem + gadget.GetName(), new String[0], 1, false, false), - new IButton() - { - public void onClick(Player player, ClickType clickType) { - playAcceptSound(player); - gadget.Disable(player); - refresh(); - }; - }); + return UtilText.splitLinesToArray(new String[] { + C.blankLine, + C.cWhite + "You own " + C.cYellow + ownedCount + "/" + maxCount, + C.blankLine, + C.cWhite + "Active: " + C.cGreen + enabled, + C.cWhite + "Right Click to Disable", + C.blankLine, + C.cWhite + "Left Click to View Category" + }, LineFormat.LORE); } - - if (getPlugin().getMountManager().getActive(getPlayer()) != null) + else { - final Mount mount = getPlugin().getMountManager().getActive(getPlayer()); - - addButton(23 + 9, - new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), C.mItem + mount.GetName(), new String[0], 1, false, false), - new IButton() - { - public void onClick(Player player, ClickType clickType) - { - playAcceptSound(player); - mount.Disable(player); - refresh(); - } - }); - } - - if (getPlugin().getPetManager().hasActivePet(getPlayer().getName())) - { - Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName()); - String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName(); - addButton(25 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false), - new IButton() - { - public void onClick(Player player, ClickType clickType) - { - playAcceptSound(player); - getPlugin().getPetManager().RemovePet(player, true); - refresh(); - } - }); + return UtilText.splitLinesToArray(new String[] { + C.blankLine, + C.cWhite + "You own " + C.cYellow + ownedCount + "/" + maxCount, + C.blankLine, + C.cWhite + "Left Click to View Category" + }, LineFormat.LORE); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java index b253a4ea7..c52c84e2b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java @@ -79,7 +79,7 @@ public class ConfirmationPage Date: Mon, 14 Dec 2015 15:33:09 +1100 Subject: [PATCH 50/51] xmas a little harder --- .../nautilus/game/arcade/game/games/christmas/Christmas.java | 2 +- .../game/arcade/game/games/christmas/content/CaveGiant.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java index 226fbcb51..8d129fc69 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/Christmas.java @@ -488,7 +488,7 @@ public class Christmas extends SoloGame } else { - UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "Winter Chest x2" + C.cGray + ".")); + UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "2x Winter Holiday Treasure" + C.cGray + ".")); } } }, player, "CC Reward 2015"); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java index 153e41aa2..65c5b40d1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/christmas/content/CaveGiant.java @@ -32,8 +32,8 @@ public class CaveGiant Host.Host.CreatureAllowOverride = false; UtilEnt.Vegetate(_ent); - _ent.setMaxHealth(200); - _ent.setHealth(200); + _ent.setMaxHealth(300); + _ent.setHealth(300); _tpLoc = _ent.getLocation(); From bccade55bc5c597cece36a4054ff1fdb72f3e3af Mon Sep 17 00:00:00 2001 From: Cheese Date: Mon, 14 Dec 2015 15:43:45 +1100 Subject: [PATCH 51/51] reduced coal fumes size --- .../gadget/gadgets/particle/ParticleCoalFumes.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java index 364d388d2..587d8d56d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCoalFumes.java @@ -28,19 +28,12 @@ public class ParticleCoalFumes extends ParticleGadget @EventHandler public void onUpdate(UpdateEvent event) { - if(event.getType() != UpdateType.TICK) return; - -// int dur = 200; -// int tick = Math.abs(event.getTick()%dur); - - -// double d = tick/(double)dur; -// float xz = (float) Math.sin(d*Math.PI); - float xz = 2; + if(event.getType() != UpdateType.TICK) + return; for(Player p : GetActive()) { - UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, p.getLocation(), xz, 0, xz, 0, 5, ViewDist.NORMAL); + UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, p.getLocation(), 0.8f, 0, 0.8f, 0, 6, ViewDist.NORMAL); } }