Fix disableCustom not firing properly

This commit is contained in:
Shaun Bennett 2016-07-14 02:47:49 -05:00
parent 7cc44c8bfc
commit e28320b361
32 changed files with 54 additions and 57 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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()) + "."));

View File

@ -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()) + "."));

View File

@ -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()) + "."));
}

View File

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

View File

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

View File

@ -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()) + "."));
}
}

View File

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

View File

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