From e28320b361c827ecb63a87fc7c75990d85c353df Mon Sep 17 00:00:00 2001 From: Shaun Bennett Date: Thu, 14 Jul 2016 02:47:49 -0500 Subject: [PATCH] Fix disableCustom not firing properly --- .../core/gadget/gadgets/balloons/BabyCowBalloon.java | 2 +- .../mineplex/core/gadget/gadgets/item/ItemBatGun.java | 4 ++-- .../core/gadget/gadgets/item/ItemEtherealPearl.java | 4 ++-- .../core/gadget/gadgets/item/ItemPaintbrush.java | 4 ++-- .../mineplex/core/gadget/gadgets/morph/MorphBat.java | 2 +- .../core/gadget/gadgets/morph/MorphBlaze.java | 2 +- .../core/gadget/gadgets/morph/MorphBlock.java | 2 +- .../core/gadget/gadgets/morph/MorphBunny.java | 2 +- .../core/gadget/gadgets/morph/MorphChicken.java | 2 +- .../mineplex/core/gadget/gadgets/morph/MorphCow.java | 2 +- .../core/gadget/gadgets/morph/MorphCreeper.java | 2 +- .../core/gadget/gadgets/morph/MorphEnderman.java | 2 +- .../mineplex/core/gadget/gadgets/morph/MorphPig.java | 2 +- .../core/gadget/gadgets/morph/MorphPumpkinKing.java | 3 +-- .../core/gadget/gadgets/morph/MorphSlime.java | 2 +- .../core/gadget/gadgets/morph/MorphSnowman.java | 2 +- .../core/gadget/gadgets/morph/MorphTitan.java | 2 +- .../core/gadget/gadgets/morph/MorphUncleSam.java | 2 +- .../core/gadget/gadgets/morph/MorphVillager.java | 2 +- .../core/gadget/gadgets/morph/MorphWither.java | 4 ++-- .../core/gadget/gadgets/outfit/OutfitTeam.java | 6 +++--- .../gadgets/outfit/ravesuit/OutfitRaveSuit.java | 4 ++-- .../gadgets/outfit/spacesuit/OutfitSpaceSuit.java | 4 ++-- .../gadgets/outfit/windupsuit/OutfitWindUpSuit.java | 4 ++-- .../core/gadget/gadgets/particle/ParticleFairy.java | 2 +- .../core/gadget/gadgets/particle/ParticleKronos.java | 2 +- .../gadgets/particle/cupidslove/ParticleHeart.java | 2 +- .../src/mineplex/core/gadget/types/Gadget.java | 7 +------ .../src/mineplex/core/gadget/types/HatGadget.java | 11 ++++++----- .../src/mineplex/core/gadget/types/ItemGadget.java | 11 ++++++----- .../src/mineplex/core/gadget/types/OutfitGadget.java | 7 ++++--- .../mineplex/core/gadget/types/ParticleGadget.java | 2 +- 32 files changed, 54 insertions(+), 57 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/balloons/BabyCowBalloon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/balloons/BabyCowBalloon.java index 883957f59..4b1e7e23f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/balloons/BabyCowBalloon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/balloons/BabyCowBalloon.java @@ -41,7 +41,7 @@ public class BabyCowBalloon extends BalloonGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { _entityStand.remove(); _balloonEntity.remove(); 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 a9add458a..f0c658846 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 @@ -47,9 +47,9 @@ public class ItemBatGun extends ItemGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - super.disableCustom(player); + super.disableCustom(player, message); Clear(player); } 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 973d2f55d..96fa54ed6 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 @@ -42,9 +42,9 @@ public class ItemEtherealPearl extends ItemGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - super.disableCustom(player); + super.disableCustom(player, message); } @Override 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 0c75b1a81..98171d0c3 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 @@ -89,13 +89,13 @@ public class ItemPaintbrush extends ItemGadget @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { _brushColor.remove(player.getName()); _brushPrevious.remove(player.getName()); _playerLocation.remove(player.getName()); - RemoveItem(player); + RemoveItem(player, message); } @EventHandler 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 d8ca2a8eb..5a3e85f68 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 @@ -65,7 +65,7 @@ public class MorphBat extends MorphGadget implements IThrown } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 57bb92473..0708fe148 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 @@ -48,7 +48,7 @@ public class MorphBlaze extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 c04d0eba3..e1c9a15aa 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 @@ -54,7 +54,7 @@ public class MorphBlock extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); 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 60bd653e9..762dc9a7c 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 @@ -79,7 +79,7 @@ public class MorphBunny extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { _jumpCharge.remove(player); this.RemoveArmor(player); 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 34a3cd6b9..20c997d91 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 @@ -54,7 +54,7 @@ public class MorphChicken extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 4cbe53990..652c35330 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 @@ -42,7 +42,7 @@ public class MorphCow extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 fe68c21f0..149c59a82 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 @@ -56,7 +56,7 @@ public class MorphCreeper extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 e167ec7c8..59e7d9e2f 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 @@ -53,7 +53,7 @@ public class MorphEnderman extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 b8a94970b..5a0e4f4c2 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 @@ -55,7 +55,7 @@ public class MorphPig extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 7bed212fc..ae4aa8913 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 @@ -1,6 +1,5 @@ package mineplex.core.gadget.gadgets.morph; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.entity.Skeleton.SkeletonType; @@ -47,7 +46,7 @@ public class MorphPumpkinKing extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 a184823ac..7ea51f3f0 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 @@ -65,7 +65,7 @@ public class MorphSlime extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(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 index e8b1786ef..3996d5626 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 @@ -66,7 +66,7 @@ public class MorphSnowman extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 9881ffa93..c2bcd1cc7 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 @@ -70,7 +70,7 @@ public class MorphTitan extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphUncleSam.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphUncleSam.java index 5c525b591..44cad0b25 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphUncleSam.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphUncleSam.java @@ -46,7 +46,7 @@ public class MorphUncleSam extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); 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 9290bd13b..3480504e3 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 @@ -64,7 +64,7 @@ public class MorphVillager extends MorphGadget implements IThrown } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); 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 aa1f7a03f..505551d3b 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 @@ -73,7 +73,7 @@ public class MorphWither extends MorphGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { this.RemoveArmor(player); Manager.getDisguiseManager().undisguise(player); @@ -200,7 +200,7 @@ public class MorphWither extends MorphGadget if (disguise == null || !(disguise instanceof DisguiseWither)) { - disableCustom(player); + disableCustom(player, true); activeIterator.remove(); continue; } 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 8aa3d98ad..087893c88 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 @@ -77,7 +77,7 @@ public class OutfitTeam extends OutfitGadget } @Override - public void removeArmor(Player player) + public void removeArmor(Player player, boolean message) { if (!_active.remove(player)) return; @@ -96,9 +96,9 @@ public class OutfitTeam extends OutfitGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - removeArmor(player); + removeArmor(player, message); } @EventHandler(priority=EventPriority.LOWEST) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/ravesuit/OutfitRaveSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/ravesuit/OutfitRaveSuit.java index 4140410f4..adfef82bc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/ravesuit/OutfitRaveSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/ravesuit/OutfitRaveSuit.java @@ -43,9 +43,9 @@ public class OutfitRaveSuit extends OutfitGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - removeArmor(player); + removeArmor(player, message); _colorPhase.remove(player.getName()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/spacesuit/OutfitSpaceSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/spacesuit/OutfitSpaceSuit.java index d27a3f56c..bac66d1ae 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/spacesuit/OutfitSpaceSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/spacesuit/OutfitSpaceSuit.java @@ -32,9 +32,9 @@ public class OutfitSpaceSuit extends OutfitGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - removeArmor(player); + removeArmor(player, message); } @EventHandler diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java index c67e5a9c2..974ff360a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java @@ -41,9 +41,9 @@ public class OutfitWindUpSuit extends OutfitGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - removeArmor(player); + removeArmor(player, message); _colorPhase.remove(player); _percentage.remove(player); 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 a72364d41..2116e7604 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 @@ -36,7 +36,7 @@ public class ParticleFairy extends ParticleGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + ".")); 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 da57bfcb6..1b3751877 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 @@ -61,7 +61,7 @@ public class ParticleKronos extends ParticleGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + ".")); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/cupidslove/ParticleHeart.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/cupidslove/ParticleHeart.java index b10b946f5..db4464335 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/cupidslove/ParticleHeart.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/cupidslove/ParticleHeart.java @@ -46,7 +46,7 @@ public class ParticleHeart extends ParticleGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + ".")); } 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 90645d5bb..20742f4f3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/Gadget.java @@ -146,17 +146,12 @@ public abstract class Gadget extends SalesPackageBase implements Listener UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(getName()) + ".")); } - public void disableCustom(Player player) - { - disableCustom(player, true); - } - public void disableCustom(Player player, boolean message) { if (_active.remove(player) && message) UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(getName()) + ".")); } - + @Override public void sold(Player player, CurrencyType currencyType) { 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 55c249907..6c647876c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/HatGadget.java @@ -59,12 +59,13 @@ public abstract class HatGadget extends OutfitGadget player.getInventory().setHelmet(getHelmetItem()); } - public void removeArmor(Player player) + public void removeArmor(Player player, boolean message) { if (!_active.remove(player)) return; - - UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + ".")); + + if (message) + UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + ".")); player.getInventory().setHelmet(null); } @@ -96,9 +97,9 @@ public abstract class HatGadget extends OutfitGadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - removeArmor(player); + removeArmor(player, message); } public HatType getHatType() 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 e6125a64f..657ad67ac 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ItemGadget.java @@ -56,9 +56,9 @@ public abstract class ItemGadget extends Gadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { - RemoveItem(player); + RemoveItem(player, message); } public HashSet getActive() @@ -113,13 +113,14 @@ public abstract class ItemGadget extends Gadget } } - public void RemoveItem(Player player) + public void RemoveItem(Player player, boolean message) { if (_active.remove(player)) { player.getInventory().setItem(Manager.getActiveItemSlot(), null); - - UtilPlayer.message(player, F.main("Gadget", "You unequipped " + F.elem(getName()) + ".")); + + if (message) + UtilPlayer.message(player, F.main("Gadget", "You unequipped " + F.elem(getName()) + ".")); } } 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 1b0d32d54..72edc0486 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/OutfitGadget.java @@ -68,12 +68,13 @@ public abstract class OutfitGadget extends Gadget ItemStackFactory.Instance.CreateStack(getDisplayMaterial().getId(), getDisplayData(), 1, getName())); } - public void removeArmor(Player player) + public void removeArmor(Player player, boolean message) { if (!_active.remove(player)) return; - - UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + ".")); + + if (message) + UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + ".")); if (_slot == ArmorSlot.Helmet) player.getInventory().setHelmet(null); else if (_slot == ArmorSlot.Chest) player.getInventory().setChestplate(null); 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 aaaeb60d0..06af3908b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/ParticleGadget.java @@ -41,7 +41,7 @@ public abstract class ParticleGadget extends Gadget } @Override - public void disableCustom(Player player) + public void disableCustom(Player player, boolean message) { if (_active.remove(player)) {