TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/commands/Command_wipeuserdata.java

32 lines
1.1 KiB
Java
Raw Normal View History

package me.totalfreedom.totalfreedommod.commands;
2014-05-11 17:03:11 +00:00
import java.io.File;
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
import me.totalfreedom.totalfreedommod.util.FUtil;
2014-05-11 17:03:11 +00:00
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = PlayerRank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
2014-05-11 17:03:11 +00:00
@CommandParameters(description = "Removes essentials playerdata", usage = "/<command>")
public class Command_wipeuserdata extends FreedomCommand
2014-05-11 17:03:11 +00:00
{
2014-05-11 17:03:11 +00:00
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
2014-05-11 17:03:11 +00:00
{
if (!server.getPluginManager().isPluginEnabled("Essentials"))
{
playerMsg("Essentials is not enabled on this server");
return true;
}
FUtil.adminAction(sender.getName(), "Wiping Essentials playerdata", true);
2014-05-11 17:03:11 +00:00
FUtil.deleteFolder(new File(server.getPluginManager().getPlugin("Essentials").getDataFolder(), "userdata"));
2014-05-11 17:03:11 +00:00
playerMsg("All playerdata deleted.");
return true;
}
}