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

36 lines
1.1 KiB
Java
Raw Normal View History

package me.totalfreedom.totalfreedommod.command;
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;
2020-08-15 22:42:46 +00:00
@CommandPermissions(level = Rank.TRIAL_MOD, 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;
}
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;
}
2020-08-15 22:42:46 +00:00
FUtil.staffAction(sender.getName(), "Undisguising all " + (admins ? "players" : "non-staff"), true);
2018-12-29 19:41:48 +00:00
plugin.ldb.undisguiseAll(admins);
return true;
}
}