From a6a4c8be361bf8303b614d10dbad9f7ed8c694eb Mon Sep 17 00:00:00 2001 From: xGamingDudex Date: Fri, 11 Dec 2015 01:05:32 +0100 Subject: [PATCH] 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()) {