package de.teleportsuite.commands;
import de.teleportsuite.TeleportSuite;
import org.bukkit.command.*;
public class DelPortalCommand implements CommandExecutor {
    private final TeleportSuite plugin;
    public DelPortalCommand(TeleportSuite p) { this.plugin = p; }
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!sender.hasPermission("teleportsuite.delportal")) { sender.sendMessage(plugin.getConfigManager().getMessage("no-permission")); return true; }
        if (args.length < 1) { sender.sendMessage("§cVerwendung: /delportal <name>"); return true; }
        boolean deleted = plugin.getPortalManager().deletePortal(args[0]);
        sender.sendMessage(deleted ? plugin.getConfigManager().getMessage("portal-deleted","name",args[0]) : "§cPortal nicht gefunden.");
        return true;
    }
}
