package de.teleportsuite.commands;
import de.teleportsuite.TeleportSuite;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
public class SavePointCommand implements CommandExecutor {
    private final TeleportSuite plugin;
    public SavePointCommand(TeleportSuite p) { this.plugin = p; }
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (!(sender instanceof Player)) { sender.sendMessage("§cNur für Spieler!"); return true; }
        Player p = (Player) sender;
        if (!p.hasPermission("teleportsuite.savepoint")) { p.sendMessage(plugin.getConfigManager().getMessage("no-permission")); return true; }
        String name = args.length > 0 ? args[0] : "default";
        plugin.getSavePointManager().teleportToSavePoint(p, name);
        return true;
    }
}
