Fix disableCustom not firing properly
This commit is contained in:
parent
7cc44c8bfc
commit
e28320b361
@ -41,7 +41,7 @@ public class BabyCowBalloon extends BalloonGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_entityStand.remove();
|
||||
_balloonEntity.remove();
|
||||
|
@ -47,9 +47,9 @@ public class ItemBatGun extends ItemGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
super.disableCustom(player);
|
||||
super.disableCustom(player, message);
|
||||
|
||||
Clear(player);
|
||||
}
|
||||
|
@ -42,9 +42,9 @@ public class ItemEtherealPearl extends ItemGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
super.disableCustom(player);
|
||||
super.disableCustom(player, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,13 +89,13 @@ public class ItemPaintbrush extends ItemGadget
|
||||
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_brushColor.remove(player.getName());
|
||||
_brushPrevious.remove(player.getName());
|
||||
_playerLocation.remove(player.getName());
|
||||
|
||||
RemoveItem(player);
|
||||
RemoveItem(player, message);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -65,7 +65,7 @@ public class MorphBat extends MorphGadget implements IThrown
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -48,7 +48,7 @@ public class MorphBlaze extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -54,7 +54,7 @@ public class MorphBlock extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class MorphBunny extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
_jumpCharge.remove(player);
|
||||
this.RemoveArmor(player);
|
||||
|
@ -54,7 +54,7 @@ public class MorphChicken extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -42,7 +42,7 @@ public class MorphCow extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -56,7 +56,7 @@ public class MorphCreeper extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -53,7 +53,7 @@ public class MorphEnderman extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -55,7 +55,7 @@ public class MorphPig extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -1,6 +1,5 @@
|
||||
package mineplex.core.gadget.gadgets.morph;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||
@ -47,7 +46,7 @@ public class MorphPumpkinKing extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -65,7 +65,7 @@ public class MorphSlime extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -66,7 +66,7 @@ public class MorphSnowman extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -70,7 +70,7 @@ public class MorphTitan extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -46,7 +46,7 @@ public class MorphUncleSam extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class MorphVillager extends MorphGadget implements IThrown
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
|
@ -73,7 +73,7 @@ public class MorphWither extends MorphGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
this.RemoveArmor(player);
|
||||
Manager.getDisguiseManager().undisguise(player);
|
||||
@ -200,7 +200,7 @@ public class MorphWither extends MorphGadget
|
||||
|
||||
if (disguise == null || !(disguise instanceof DisguiseWither))
|
||||
{
|
||||
disableCustom(player);
|
||||
disableCustom(player, true);
|
||||
activeIterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class OutfitTeam extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
@ -96,9 +96,9 @@ public class OutfitTeam extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
@EventHandler(priority=EventPriority.LOWEST)
|
||||
|
@ -43,9 +43,9 @@ public class OutfitRaveSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
_colorPhase.remove(player.getName());
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,9 @@ public class OutfitSpaceSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -41,9 +41,9 @@ public class OutfitWindUpSuit extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
_colorPhase.remove(player);
|
||||
_percentage.remove(player);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class ParticleFairy extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class ParticleKronos extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
|
@ -46,7 +46,7 @@ public class ParticleHeart extends ParticleGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player)) UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
@ -146,11 +146,6 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
||||
UtilPlayer.message(player, F.main("Gadget", "You enabled " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
||||
public void disableCustom(Player player)
|
||||
{
|
||||
disableCustom(player, true);
|
||||
}
|
||||
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player) && message)
|
||||
|
@ -59,11 +59,12 @@ public abstract class HatGadget extends OutfitGadget
|
||||
player.getInventory().setHelmet(getHelmetItem());
|
||||
}
|
||||
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
player.getInventory().setHelmet(null);
|
||||
@ -96,9 +97,9 @@ public abstract class HatGadget extends OutfitGadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
removeArmor(player);
|
||||
removeArmor(player, message);
|
||||
}
|
||||
|
||||
public HatType getHatType()
|
||||
|
@ -56,9 +56,9 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
RemoveItem(player);
|
||||
RemoveItem(player, message);
|
||||
}
|
||||
|
||||
public HashSet<Player> getActive()
|
||||
@ -113,12 +113,13 @@ public abstract class ItemGadget extends Gadget
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveItem(Player player)
|
||||
public void RemoveItem(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
{
|
||||
player.getInventory().setItem(Manager.getActiveItemSlot(), null);
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You unequipped " + F.elem(getName()) + "."));
|
||||
}
|
||||
}
|
||||
|
@ -68,11 +68,12 @@ public abstract class OutfitGadget extends Gadget
|
||||
ItemStackFactory.Instance.CreateStack(getDisplayMaterial().getId(), getDisplayData(), 1, getName()));
|
||||
}
|
||||
|
||||
public void removeArmor(Player player)
|
||||
public void removeArmor(Player player, boolean message)
|
||||
{
|
||||
if (!_active.remove(player))
|
||||
return;
|
||||
|
||||
if (message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You took off " + F.elem(getName()) + "."));
|
||||
|
||||
if (_slot == ArmorSlot.Helmet) player.getInventory().setHelmet(null);
|
||||
|
@ -41,7 +41,7 @@ public abstract class ParticleGadget extends Gadget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableCustom(Player player)
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user