/** * Generates icons using the IconExporter mod and HeadlessMC. * This class downloads HeadlessMC and the IconExporter mod, sets up a headless * Minecraft client with NeoForge and all specified mods, launches the game, * runs the iconexporter export command, and copies the resulting icons. */ export declare class IconsGenerator { private static readonly headlessMcJar; private static readonly iconExporterJar; private static readonly hmcGameSubdir; private static readonly hmcConfigSubdir; private static readonly iconExportSubdir; private static readonly defaultIconSize; private static readonly hmcSpecificsRepo; private static readonly modrinthApiBase; private static readonly iconExporterModrinthSlug; private readonly modsDir; private readonly iconsDir; private readonly workDir; private readonly minecraftVersion; private readonly neoforgeVersion; private readonly iconExporterVersion; private readonly headlessMcVersion; private readonly launchTimeoutMs; constructor(args: IIconsGeneratorArgs); /** * Run the full icon generation pipeline. */ generate(): Promise; /** * Download the HeadlessMC launcher jar. */ downloadHeadlessMc(): Promise; /** * Download the IconExporter mod from Modrinth. * If an explicit version is configured, fetches that specific version; otherwise fetches the * latest version for the configured Minecraft version. No authentication is required. */ downloadIconExporter(): Promise; /** * Fetch an IconExporter release from Modrinth for the configured Minecraft version and the * NeoForge loader. If a specific version number is provided, that version is matched; * otherwise the latest (newest) version is returned. * Returns the primary file's download URL and filename. */ fetchIconExporterFromModrinth(version?: string): Promise<{ url: string; filename: string; }>; /** * Set up the game directory with mods and options. */ setupGameDirectory(): Promise; /** * Write the HeadlessMC configuration file. */ writeHmcConfig(): void; /** * Run the Minecraft client using HeadlessMC and export icons. */ runGameAndExportIcons(): Promise; /** * Copy exported icons to the output icons directory. */ copyIcons(): Promise; /** * Parse the HeadlessMC `gui` command output and find the numeric button ID for a given * button text label. HeadlessMC's `click` command requires a numeric id, not the text. * The gui table format is: * id text x y w h on type * 0 Multiplayer 140 123 200 20 1 Button * 1 Singleplayer 140 99 200 20 1 Button * Columns are separated by two or more spaces. */ findButtonIdByText(guiOutput: string, buttonText: string): number | null; /** * Determine if the Minecraft game has fully loaded based on log output. */ isGameFullyLoaded(output: string): boolean; /** * Determine if the HeadlessMC launcher is ready to accept commands based on its startup output. * In non-TTY mode HeadlessMC does not print a '>' prompt, so we detect readiness from the * version-table header or the DefaultCommandLineProvider warning it prints on startup. */ isHeadlessMcReady(output: string): boolean; /** * Download the hmc-specifics mod from GitHub Releases into the given mods directory. * This avoids relying on HeadlessMC's built-in `-specifics` auto-download which checks * the GitHub API without authentication and can hit rate limits. */ downloadHmcSpecifics(modsDir: string): Promise; /** * Download a file from a URL to a destination path. */ downloadFile(url: string, destPath: string, headers?: Record): Promise; } export type IGameState = 'waiting_for_prompt' | 'game_launching' | 'checking_screen' | 'navigating_singleplayer' | 'creating_world' | 'exporting_icons' | 'quitting'; export interface IModrinthVersionFile { url: string; filename: string; primary: boolean; } export interface IModrinthVersion { version_number: string; files: IModrinthVersionFile[]; } export interface IGithubAsset { name: string; browser_download_url: string; } export interface IGithubRelease { assets: IGithubAsset[]; tag_name: string; } export interface IIconsGeneratorArgs { /** * Directory containing mod JARs to include in the client (usually server/mods). */ modsDir: string; /** * Directory where icons will be written. */ iconsDir: string; /** * Working directory for HeadlessMC and game files. */ workDir: string; /** * Minecraft version (e.g., "1.21.1"). */ minecraftVersion: string; /** * NeoForge version (e.g., "21.1.210"). */ neoforgeVersion: string; /** * Version of the IconExporter artifact to pin (e.g., "1.4.0-174"). * If not provided, the latest version for the configured Minecraft version is * automatically fetched from Modrinth (no authentication required). */ iconExporterVersion?: string; /** * Version of HeadlessMC to download (e.g., "2.8.0"). */ headlessMcVersion?: string; /** * Timeout in milliseconds for the full game launch and icon export (default: 30 minutes). */ launchTimeoutMs?: number; }