From f9b66e28f4650ad0c621ca5a021fe26f78f313d7 Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Sat, 4 Mar 2017 14:07:24 -0300 Subject: [PATCH] Fixed taunts not being disabled correctly --- .../core/cosmetic/ui/page/TauntPage.java | 8 +++++--- .../src/mineplex/core/gadget/GadgetManager.java | 17 +++++++++-------- .../mineplex/core/gadget/types/TauntGadget.java | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) 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 index a519cfce8..b4e8a1568 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/TauntPage.java @@ -29,7 +29,7 @@ public class TauntPage extends GadgetPage @Override protected void buildPage() { - int slot = 10; + int slot = 10; List list = getPlugin().getGadgetManager().getGadgets(GadgetType.TAUNT); if(list != null) @@ -37,8 +37,10 @@ public class TauntPage extends GadgetPage { addGadget(gadget, slot); - if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.TAUNT) == gadget) - addGlow(slot); + if (gadget.isActive(getPlayer())) + { + addGlow(slot); + } slot++; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 1d459ecb4..014504a07 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -2,8 +2,10 @@ package mineplex.core.gadget; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.UUID; import java.util.function.Predicate; @@ -28,7 +30,6 @@ import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.common.util.F; -import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; @@ -256,10 +257,10 @@ public class GadgetManager extends MiniPlugin private TreasureManager _treasureManager; private SoulManager _soulManager; - private NautHashMap> _gadgets; + private Map> _gadgets; - private final NautHashMap _lastMove = new NautHashMap<>(); - private final NautHashMap> _playerActiveGadgetMap = new NautHashMap<>(); + private final Map _lastMove = new HashMap<>(); + private final Map> _playerActiveGadgetMap = new HashMap<>(); private final HashSet _sets = new HashSet<>(); @@ -336,7 +337,7 @@ public class GadgetManager extends MiniPlugin private void createGadgets() { - _gadgets = new NautHashMap<>(); + _gadgets = new HashMap<>(); // Items addGadget(new ItemEtherealPearl(this)); @@ -1040,7 +1041,7 @@ public class GadgetManager extends MiniPlugin public void setActive(Player player, Gadget gadget) { if (!_playerActiveGadgetMap.containsKey(player)) - _playerActiveGadgetMap.put(player, new NautHashMap()); + _playerActiveGadgetMap.put(player, new HashMap<>()); _playerActiveGadgetMap.get(player).put(gadget.getGadgetType(), gadget); } @@ -1048,7 +1049,7 @@ public class GadgetManager extends MiniPlugin public Gadget getActive(Player player, GadgetType gadgetType) { if (!_playerActiveGadgetMap.containsKey(player)) - _playerActiveGadgetMap.put(player, new NautHashMap()); + _playerActiveGadgetMap.put(player, new HashMap<>()); return _playerActiveGadgetMap.get(player).get(gadgetType); } @@ -1056,7 +1057,7 @@ public class GadgetManager extends MiniPlugin public void removeActive(Player player, Gadget gadget) { if (!_playerActiveGadgetMap.containsKey(player)) - _playerActiveGadgetMap.put(player, new NautHashMap()); + _playerActiveGadgetMap.put(player, new HashMap<>()); _playerActiveGadgetMap.get(player).remove(gadget.getGadgetType()); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java index 6076bcf0c..730cbcfcd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java @@ -70,6 +70,7 @@ public abstract class TauntGadget extends Gadget @Override public void disableCustom(Player player, boolean message) { + super.disableCustom(player, message); finish(player); }