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 59f9bcb46..503cef717 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 @@ -17,6 +17,7 @@ import org.bukkit.util.Vector; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; @@ -36,6 +37,9 @@ import mineplex.core.gadget.gadgets.morph.managers.UtilMorph; import mineplex.core.gadget.types.MorphGadget; import mineplex.core.inventory.ClientItem; import mineplex.core.inventory.data.Item; +import mineplex.core.mount.DragonMount; +import mineplex.core.mount.Mount; +import mineplex.core.mount.types.MountDragon; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -59,6 +63,12 @@ public class MorphWither extends MorphGadget @Override public void enableCustom(final Player player, boolean message) { + Mount mount = Manager.getMountManager().getActive(player); + if (mount instanceof DragonMount) + { + UtilPlayer.message(player, F.main("Gadget", "You cannot enable the " + F.elem(mount.getName()) + " and the " + F.elem(getName()) + " at the same time")); + Manager.getMountManager().DeregisterAll(player); + } this.applyArmor(player, message); player.setMaxHealth(300); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonMount.java b/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonMount.java index 242e21dfa..beec06662 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonMount.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/mount/DragonMount.java @@ -3,8 +3,13 @@ package mineplex.core.mount; import org.bukkit.Material; import org.bukkit.entity.Player; +import mineplex.core.Managers; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.gadgets.morph.MorphWither; +import mineplex.core.gadget.types.Gadget; +import mineplex.core.gadget.types.GadgetType; public class DragonMount extends Mount { @@ -18,6 +23,14 @@ public class DragonMount extends Mount @Override public void enableCustom(final Player player) { + GadgetManager gadgetManager = Managers.get(GadgetManager.class); + Gadget morph = gadgetManager.getActive(player, GadgetType.MORPH); + if (morph instanceof MorphWither) + { + UtilPlayer.message(player, F.main("Gadget", "You cannot enable the " + F.elem(getName()) + " and the " + F.elem(morph.getName()) + " at the same time")); + morph.disable(player, true); + } + player.leaveVehicle(); player.eject();