Fixes for winroom gadget disable messages
This commit is contained in:
parent
2121d736a6
commit
6af04b5438
@ -671,7 +671,7 @@ public class GadgetManager extends MiniPlugin
|
||||
}
|
||||
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
{
|
||||
gadget.disable(player);
|
||||
gadget.disable(player, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,13 +123,18 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
||||
}
|
||||
|
||||
public void disable(Player player)
|
||||
{
|
||||
disable(player, true);
|
||||
}
|
||||
|
||||
public void disable(Player player, boolean message)
|
||||
{
|
||||
if (isActive(player))
|
||||
{
|
||||
Manager.removeActive(player, this);
|
||||
GadgetDisableEvent event = new GadgetDisableEvent(player, this);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
disableCustom(player);
|
||||
disableCustom(player, message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +148,12 @@ public abstract class Gadget extends SalesPackageBase implements Listener
|
||||
|
||||
public void disableCustom(Player player)
|
||||
{
|
||||
if (_active.remove(player))
|
||||
disableCustom(player, true);
|
||||
}
|
||||
|
||||
public void disableCustom(Player player, boolean message)
|
||||
{
|
||||
if (_active.remove(player) && message)
|
||||
UtilPlayer.message(player, F.main("Gadget", "You disabled " + F.elem(getName()) + "."));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user