package de.teleportsuite.commands;
import de.teleportsuite.TeleportSuite;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
public class DelWarpCommand implements CommandExecutor {
    private final TeleportSuite plugin;
    public DelWarpCommand(TeleportSuite p) { this.plugin = p; }
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!sender.hasPermission("teleportsuite.delwarp")) { sender.sendMessage(plugin.getConfigManager().getMessage("no-permission")); return true; }
        if (args.length < 1) { sender.sendMessage("§cVerwendung: /delwarp <name>"); return true; }
        boolean deleted = plugin.getWarpManager().deleteWarp(args[0]);
        sender.sendMessage(deleted ? plugin.getConfigManager().getMessage("warp-deleted","name",args[0]) : plugin.getConfigManager().getMessage("warp-not-found","name",args[0]));
        return true;
    }
}
