Add /wipeuserdata. Resolves #177

This commit is contained in:
unknown 2014-05-11 19:03:11 +02:00
parent 0435174342
commit bd9d6114ba
2 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sun May 11 18:41:12 CEST 2014
build.number=830
#Sun May 11 19:02:31 CEST 2014
build.number=832

View File

@ -0,0 +1,29 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import java.io.File;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE)
@CommandParameters(description = "Removes essentials playerdata", usage = "/<command>")
public class Command_wipeuserdata extends TFM_Command
{
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (!server.getPluginManager().isPluginEnabled("Essentials"))
{
playerMsg("Essentials is not enabled on this server");
return true;
}
TFM_Util.adminAction(sender.getName(), "Wiping Essentials playerdata", true);
TFM_Util.deleteFolder(new File(server.getPluginManager().getPlugin("Essentials").getDataFolder(), "userdata"));
playerMsg("All playerdata deleted.");
return true;
}
}