Fixed multi-morphs
This commit is contained in:
parent
1a6540b4d0
commit
59859b168f
@ -174,6 +174,22 @@ public class GadgetManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveMorph(Player player)
|
||||
{
|
||||
for (GadgetType gadgetType : _gadgets.keySet())
|
||||
{
|
||||
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
{
|
||||
if (gadget instanceof MorphGadget)
|
||||
{
|
||||
MorphGadget part = (MorphGadget) gadget;
|
||||
|
||||
part.Disable(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableAll()
|
||||
{
|
||||
|
@ -34,14 +34,16 @@ public abstract class MorphGadget extends Gadget
|
||||
|
||||
public void ApplyArmor(Player player)
|
||||
{
|
||||
Manager.RemoveMorph(player);
|
||||
|
||||
_active.add(player);
|
||||
|
||||
UtilPlayer.message(player, F.main("Gadget", "You put on " + F.elem(GetName()) + "."));
|
||||
UtilPlayer.message(player, F.main("Gadget", "You morphed into " + F.elem(GetName()) + "."));
|
||||
}
|
||||
|
||||
public void RemoveArmor(Player player)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(GetName()) + "."));
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unmorphed from " + F.elem(GetName()) + "."));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user