2016-07-21 21:53:25 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
2018-07-25 00:06:58 +00:00
|
|
|
import me.totalfreedom.libsdisguise.DisallowedDisguises;
|
2016-07-21 21:53:25 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
|
|
import org.bukkit.ChatColor;
|
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
|
|
|
{
|
|
|
|
msg(ChatColor.RED + "LibsDisguises is not enabled.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-07-25 00:06:58 +00:00
|
|
|
FUtil.adminAction(sender.getName(), (DisallowedDisguises.disabled ? "Enabling" : "Disabling")
|
|
|
|
+ " 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
|
|
|
}
|
|
|
|
|
2017-06-30 07:46:31 +00:00
|
|
|
msg("Disguises are now " + (!DisallowedDisguises.disabled ? "enabled." : "disabled."));
|
2016-07-21 21:53:25 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|