diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 006b0cfab..3bb6a7f2e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -45,12 +45,12 @@ import mineplex.core.gadget.event.GadgetCollideEntityEvent; import mineplex.core.gadget.event.GadgetEnableEvent; import mineplex.core.gadget.event.PlayerToggleSwimEvent; import mineplex.core.gadget.event.TauntCommandEvent; -import mineplex.core.gadget.gadgets.arrowtrail.halloween.ArrowTrailHalloween; import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane; import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid; import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald; import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom; import mineplex.core.gadget.gadgets.arrowtrail.frostlord.ArrowTrailFrostLord; +import mineplex.core.gadget.gadgets.arrowtrail.halloween.ArrowTrailHalloween; import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm; import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic; import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti; @@ -75,12 +75,12 @@ import mineplex.core.gadget.gadgets.death.spring.DeathSpring; import mineplex.core.gadget.gadgets.death.titan.DeathTitan; import mineplex.core.gadget.gadgets.death.vampire.DeathBlood; import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant; -import mineplex.core.gadget.gadgets.doublejump.halloween.DoubleJumpHalloween; import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane; import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings; import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald; import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom; import mineplex.core.gadget.gadgets.doublejump.frostlord.DoubleJumpFrostLord; +import mineplex.core.gadget.gadgets.doublejump.halloween.DoubleJumpHalloween; import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm; import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic; import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker; @@ -116,9 +116,8 @@ 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.kitselector.EmberKitSelector; -import mineplex.core.gadget.gadgets.kitselector.FlamesOfFuryKitSelector; import mineplex.core.gadget.gadgets.kitselector.HaloKitSelector; +import mineplex.core.gadget.gadgets.kitselector.SingleParticleKitSelector; import mineplex.core.gadget.gadgets.kitselector.WaterWingsKitSelector; import mineplex.core.gadget.gadgets.morph.MorphAwkwardRabbit; import mineplex.core.gadget.gadgets.morph.MorphBat; @@ -172,7 +171,6 @@ import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes; import mineplex.core.gadget.gadgets.particle.ParticleFairy; import mineplex.core.gadget.gadgets.particle.ParticleFireRings; import mineplex.core.gadget.gadgets.particle.ParticleLegend; -import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo; import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel; import mineplex.core.gadget.gadgets.particle.ParticleWingsBee; import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons; @@ -189,6 +187,7 @@ import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain; import mineplex.core.gadget.gadgets.particle.music.ParticleMusic; import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime; import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot; +import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo; import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan; import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood; import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant; @@ -602,9 +601,12 @@ public class GadgetManager extends MiniPlugin // Kit Selectors addGadget(new WaterWingsKitSelector(this)); - addGadget(new FlamesOfFuryKitSelector(this)); addGadget(new HaloKitSelector(this)); - addGadget(new EmberKitSelector(this)); + + for(SingleParticleKitSelector.SingleParticleSelectors singleParticleSelectors : SingleParticleKitSelector.SingleParticleSelectors.values()) + { + addGadget(singleParticleSelectors.getKitSelectorGadget(this)); + } // Gem Hunters Mounts for (MountType mount : MountType.values()) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/EmberKitSelector.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/EmberKitSelector.java deleted file mode 100644 index f33014f47..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/EmberKitSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -package mineplex.core.gadget.gadgets.kitselector; - -import org.bukkit.Material; -import org.bukkit.entity.Entity; -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.gadget.GadgetManager; -import mineplex.core.gadget.types.KitSelectorGadget; - -public class EmberKitSelector extends KitSelectorGadget -{ - - public EmberKitSelector(GadgetManager manager) - { - super(manager, "Halo", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), - 0, Material.GLASS, (byte) 0); - } - - @Override - public void playParticle(Entity entity, Player playTo) - { - UtilParticle.playParticleFor(playTo, UtilParticle.ParticleType.SMOKE, entity.getLocation().add(0, 1, 0), 0.5f, 0.5f, 0.5f, 0, 1, UtilParticle.ViewDist.NORMAL); - } - -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/FlamesOfFuryKitSelector.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/FlamesOfFuryKitSelector.java deleted file mode 100644 index c01297abb..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/FlamesOfFuryKitSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -package mineplex.core.gadget.gadgets.kitselector; - -import org.bukkit.Material; -import org.bukkit.entity.Entity; -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.gadget.GadgetManager; -import mineplex.core.gadget.types.KitSelectorGadget; - -public class FlamesOfFuryKitSelector extends KitSelectorGadget -{ - - public FlamesOfFuryKitSelector(GadgetManager manager) - { - super(manager, "Flames Of Fury", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), - 0, Material.GLASS, (byte) 0); - } - - @Override - public void playParticle(Entity entity, Player playTo) - { - UtilParticle.playParticleFor(playTo, UtilParticle.ParticleType.FLAME, entity.getLocation().add(0, 1, 0), 0.5f, 0.5f, 0.5f, 0, 1, UtilParticle.ViewDist.NORMAL); - } - -} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/SingleParticleKitSelector.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/SingleParticleKitSelector.java new file mode 100644 index 000000000..f0d187575 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/kitselector/SingleParticleKitSelector.java @@ -0,0 +1,66 @@ +package mineplex.core.gadget.gadgets.kitselector; + +import org.bukkit.Material; +import org.bukkit.entity.Entity; +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.gadget.GadgetManager; +import mineplex.core.gadget.types.KitSelectorGadget; + +public class SingleParticleKitSelector extends KitSelectorGadget +{ + + private UtilParticle.ParticleType _particleType; + + public SingleParticleKitSelector(GadgetManager manager, String name, String[] lore, int cost, Material mat, byte data, + UtilParticle.ParticleType particleType, String... alternativeSalesPackageNames) + { + super(manager, name, lore, cost, mat, data, alternativeSalesPackageNames); + _particleType = particleType; + } + + @Override + public void playParticle(Entity entity, Player playTo) + { + UtilParticle.playParticleFor(playTo, _particleType, entity.getLocation().add(0, 1, 0), 0.5f, 0.5f, 0.5f, 0, 1, UtilParticle.ViewDist.NORMAL); + } + + public enum SingleParticleSelectors + { + FLAMES_OF_FURY("Flames Of Fury", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), + 0, Material.GLASS, (byte) 0, UtilParticle.ParticleType.FLAME), + EMBER("Halo", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), + 0, Material.GLASS, (byte) 0, UtilParticle.ParticleType.SMOKE), + LOVE("Kit Love", UtilText.splitLinesToArray(new String[]{C.cGray + "Placeholder"}, LineFormat.LORE), + 0, Material.GLASS, (byte) 0, UtilParticle.ParticleType.HEART); + + private String _name; + private String[] _lore; + private int _cost; + private Material _material; + private byte _data; + private UtilParticle.ParticleType _particleType; + private String[] _alternativeSalesPackageNames; + + SingleParticleSelectors(String name, String[] lore, int cost, Material material, byte data, UtilParticle.ParticleType particleType, String... alternativeSalesPackageNames) + { + _name = name; + _lore = lore; + _cost = cost; + _material = material; + _data = data; + _particleType = particleType; + _alternativeSalesPackageNames = alternativeSalesPackageNames; + } + + public KitSelectorGadget getKitSelectorGadget(GadgetManager manager) + { + return new SingleParticleKitSelector(manager, _name, _lore, _cost, _material, _data, _particleType, _alternativeSalesPackageNames); + } + } + +}