TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/command/Command_undisguiseall.java

44 lines
1.3 KiB
Java
Raw Normal View History

package me.totalfreedom.totalfreedommod.command;
2020-01-12 03:55:18 +00:00
import me.totalfreedom.libsdisguises.BlockedDisguises;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Undisguise all online players on the server", usage = "/<command> [-a]", aliases = "uall")
public class Command_undisguiseall extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (!plugin.ldb.isEnabled())
{
msg("LibsDisguises is not enabled.");
return true;
}
2020-01-12 03:55:18 +00:00
if (BlockedDisguises.disabled)
{
msg("Disguises are not enabled.");
return true;
}
2018-12-29 19:41:48 +00:00
boolean admins = false;
2018-12-29 19:41:48 +00:00
if (args.length > 0 && args[0].equalsIgnoreCase("-a"))
{
admins = true;
}
FUtil.adminAction(sender.getName(), "Undisguising all " + (admins ? "players" : "non-admins"), true);
plugin.ldb.undisguiseAll(admins);
return true;
}
}