mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-18 05:16:12 +00:00
5c0f77c7c5
Lombok implementation removal. I have also gone through and replaced things with inline methods and variables, lambdas, and simplified loops down, removed unnecessary guard clauses, and overall cleaned up every single class. This took a long time, please do remember to follow proper naming conventions, don't include unnecessary guard clauses, follow exception rules and comment rules, and please PLEASE remember to use the DIAMOND OPERATOR rather than just inferring RAW TYPES!!! Thank you!!
35 lines
1.3 KiB
Java
35 lines
1.3 KiB
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import com.earth2me.essentials.Essentials;
|
|
import java.io.File;
|
|
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.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
|
@CommandParameters(description = "Removes all Essentials warps", usage = "/<command>")
|
|
public class Command_wipewarps extends FreedomCommand
|
|
{
|
|
@Override
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
{
|
|
if (!plugin.esb.isEnabled())
|
|
{
|
|
msg("Essentials is not enabled on this server.");
|
|
return true;
|
|
}
|
|
|
|
Essentials essentials = plugin.esb.getEssentialsPlugin();
|
|
File warps = new File(essentials.getDataFolder(), "warps");
|
|
FUtil.adminAction(sender.getName(), "Wiping Essentials warps", true);
|
|
FUtil.deleteFolder(warps);
|
|
//noinspection ResultOfMethodCallIgnored
|
|
warps.mkdir();
|
|
essentials.reload();
|
|
msg("All warps deleted.");
|
|
return true;
|
|
}
|
|
}
|