2017-11-16 22:32:09 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
2018-07-28 07:11:48 +00:00
|
|
|
import com.earth2me.essentials.Essentials;
|
2018-07-31 07:01:29 +00:00
|
|
|
import java.io.File;
|
2017-11-16 22:32:09 +00:00
|
|
|
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;
|
2018-07-28 07:11:48 +00:00
|
|
|
|
2020-09-28 02:51:15 +00:00
|
|
|
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
2020-03-30 23:43:57 +00:00
|
|
|
@CommandParameters(description = "Removes all Essentials warps", usage = "/<command>")
|
2017-11-16 22:32:09 +00:00
|
|
|
public class Command_wipewarps extends FreedomCommand
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
2018-07-30 07:23:01 +00:00
|
|
|
if (!plugin.esb.isEnabled())
|
2017-11-16 22:32:09 +00:00
|
|
|
{
|
2018-07-28 07:11:48 +00:00
|
|
|
msg("Essentials is not enabled on this server.");
|
2017-11-16 22:32:09 +00:00
|
|
|
return true;
|
|
|
|
}
|
2017-12-23 04:07:36 +00:00
|
|
|
|
2018-01-01 03:43:10 +00:00
|
|
|
Essentials essentials = plugin.esb.getEssentialsPlugin();
|
|
|
|
File warps = new File(essentials.getDataFolder(), "warps");
|
2020-12-04 00:28:53 +00:00
|
|
|
FUtil.adminAction(sender.getName(), "Wiping Essentials warps", true);
|
2018-01-01 03:43:10 +00:00
|
|
|
FUtil.deleteFolder(warps);
|
2020-12-25 19:46:43 +00:00
|
|
|
//noinspection ResultOfMethodCallIgnored
|
2018-01-01 03:43:10 +00:00
|
|
|
warps.mkdir();
|
|
|
|
essentials.reload();
|
2017-11-16 22:32:09 +00:00
|
|
|
msg("All warps deleted.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|