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

40 lines
1.3 KiB
Java
Raw Normal View History

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;
@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"))
{
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];
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;
}
}