From 689aebedd844a738943ff4a35ab9f41e29941afa Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 31 Jul 2018 21:22:48 +0100 Subject: [PATCH] Disable sortals is the gadget gets disabled --- .../core/gadget/gadgets/item/ItemSortal.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSortal.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSortal.java index 7d3341685..f27bb2481 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSortal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemSortal.java @@ -73,6 +73,20 @@ public class ItemSortal extends ItemGadget createAndFire(player, player.getLocation().add(0, 3, 0), 20); } + @Override + public void disableCustom(Player player, boolean message) + { + super.disableCustom(player, message); + + _sortals.forEach(sortal -> + { + if (sortal.Wielder.equals(player)) + { + sortal.remove(); + } + }); + } + @EventHandler public void adminCommand(PlayerCommandPreprocessEvent event) {