2016-07-21 21:53:25 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
2018-12-29 19:41:48 +00:00
|
|
|
import me.totalfreedom.disguise.DisguiseBlocker;
|
2016-07-21 21:53:25 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
2018-07-25 00:06:58 +00:00
|
|
|
import org.bukkit.command.Command;
|
2016-07-21 21:53:25 +00:00
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
|
|
|
@CommandParameters(description = "Toggle the disguise plugin", usage = "/<command>", aliases = "dtoggle")
|
|
|
|
public class Command_disguisetoggle extends FreedomCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
2017-10-13 18:35:11 +00:00
|
|
|
{
|
2018-07-28 07:11:48 +00:00
|
|
|
if (!plugin.ldb.isEnabled())
|
2016-07-21 21:53:25 +00:00
|
|
|
{
|
2018-07-30 07:23:01 +00:00
|
|
|
msg("LibsDisguises is not enabled.");
|
2016-07-21 21:53:25 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-12-29 19:41:48 +00:00
|
|
|
FUtil.adminAction(sender.getName(), (DisguiseBlocker.enabled ? "Disabling" : "Enabling") + " disguises", false);
|
2016-07-21 21:53:25 +00:00
|
|
|
|
2016-08-26 20:06:20 +00:00
|
|
|
if (plugin.ldb.isDisguisesEnabled())
|
2016-07-21 21:53:25 +00:00
|
|
|
{
|
|
|
|
plugin.ldb.undisguiseAll(true);
|
2016-08-26 20:06:20 +00:00
|
|
|
plugin.ldb.setDisguisesEnabled(false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
plugin.ldb.setDisguisesEnabled(true);
|
2016-07-21 21:53:25 +00:00
|
|
|
}
|
|
|
|
|
2018-12-29 19:41:48 +00:00
|
|
|
msg("Disguises are now " + (DisguiseBlocker.enabled ? "enabled." : "disabled."));
|
2016-07-21 21:53:25 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|