2016-07-21 21:53:25 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-08-15 22:41:23 +00:00
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
2020-03-30 23:43:57 +00:00
|
|
|
@CommandParameters(description = "Toggle LibsDisguises for everyone online.", usage = "/<command>", aliases = "dtoggle")
|
2016-07-21 21:53:25 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-08-15 22:41:23 +00:00
|
|
|
FUtil.adminAction(sender.getName(), (plugin.ldb.isDisguisesEnabled() ? "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
|
|
|
}
|
|
|
|
|
2020-06-30 07:25:38 +00:00
|
|
|
msg("Disguises are now " + (plugin.ldb.isDisguisesEnabled() ? "enabled." : "disabled."));
|
2016-07-21 21:53:25 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|