2018-03-03 04:29:08 +00:00
|
|
|
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 06:44:57 +00:00
|
|
|
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
2018-03-03 04:29:08 +00:00
|
|
|
@CommandParameters(description = "Wipes all logged punishments or punishments for a specific user.", usage = "/<command> <username | -a>")
|
|
|
|
public class Command_wipepunishments extends FreedomCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean run(final CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (args.length < 1)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args[0].equalsIgnoreCase("-a"))
|
|
|
|
{
|
2020-08-15 06:44:57 +00:00
|
|
|
FUtil.staffAction(sender.getName(), "Wiping the punishment history", true);
|
2018-03-03 04:29:08 +00:00
|
|
|
|
|
|
|
msg("Wiped " + plugin.pul.clear() + " punishments.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
String username = args[0];
|
|
|
|
|
2020-08-15 06:44:57 +00:00
|
|
|
FUtil.staffAction(sender.getName(), "Wiping the punishment history for " + username, true);
|
2018-03-03 04:29:08 +00:00
|
|
|
|
|
|
|
msg("Wiped " + plugin.pul.clear(username) + " punishments for " + username + ".");
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|