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;
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
2018-12-29 19:41:48 +00:00
|
|
|
@CommandParameters(description = "Undisguise all players on the server", usage = "/<command> [-a]", aliases = "uall")
|
2016-07-21 21:53:25 +00:00
|
|
|
public class Command_undisguiseall extends FreedomCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
2017-11-16 22:32:09 +00:00
|
|
|
{
|
2018-07-28 07:11:48 +00:00
|
|
|
if (!plugin.ldb.isEnabled())
|
2016-07-21 21:53:25 +00:00
|
|
|
{
|
|
|
|
msg("LibsDisguises is not enabled.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-12-29 19:41:48 +00:00
|
|
|
if (!DisguiseBlocker.enabled)
|
2016-07-21 21:53:25 +00:00
|
|
|
{
|
|
|
|
msg("Disguises are not enabled.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-12-29 19:41:48 +00:00
|
|
|
boolean admins = false;
|
2016-07-21 21:53:25 +00:00
|
|
|
|
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);
|
2016-07-21 21:53:25 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|