2016-03-02 19:28:01 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
2014-05-11 17:03:11 +00:00
|
|
|
|
|
|
|
import java.io.File;
|
2015-11-15 23:32:04 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
2015-10-19 17:43:46 +00:00
|
|
|
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;
|
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
@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>")
|
2015-10-19 17:43:46 +00:00
|
|
|
public class Command_wipeuserdata extends FreedomCommand
|
2014-05-11 17:03:11 +00:00
|
|
|
{
|
2015-10-19 17:43:46 +00:00
|
|
|
|
2014-05-11 17:03:11 +00:00
|
|
|
@Override
|
2015-11-22 18:26:47 +00:00
|
|
|
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"))
|
|
|
|
{
|
2016-03-02 19:28:01 +00:00
|
|
|
msg("Essentials is not enabled on this server");
|
2014-05-11 17:03:11 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
FUtil.adminAction(sender.getName(), "Wiping Essentials playerdata", true);
|
2014-05-11 17:03:11 +00:00
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
FUtil.deleteFolder(new File(server.getPluginManager().getPlugin("Essentials").getDataFolder(), "userdata"));
|
2014-05-11 17:03:11 +00:00
|
|
|
|
2016-03-02 19:28:01 +00:00
|
|
|
msg("All playerdata deleted.");
|
2014-05-11 17:03:11 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|