This commit is contained in:
samczsun 2017-03-15 21:44:27 -04:00 committed by cnr
parent 4553a7081f
commit bd1d73d390
2 changed files with 23 additions and 0 deletions

View File

@ -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);

View File

@ -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<DragonData>
{
@ -18,6 +23,14 @@ public class DragonMount extends Mount<DragonData>
@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();