import { Installer } from "@xmcl/installer"; import Task from "@xmcl/task"; import { JavaExecutor, MinecraftFolder, MinecraftLocation } from "@xmcl/util"; import { Version } from "@xmcl/version"; export declare namespace ForgeInstaller { interface VersionMeta { installer: { md5: string; sha1: string; path: string; }; universal: { md5: string; sha1: string; path: string; }; mcversion: string; version: string; } const DEFAULT_FORGE_MAVEN = "http://files.minecraftforge.net"; interface InstallProfile { spec: number; profile: string; version: string; json: string; path: string; minecraft: string; data: { [key: string]: { client: string; server: string; }; }; processors: Array<{ jar: string; classpath: string[]; args: string[]; outputs?: { [key: string]: string; }; }>; libraries: Version.NormalLibrary[]; } interface Diagnosis { /** * When this flag is true, please reinstall totally */ badInstall: boolean; /** * When only this is not empty */ badProcessedFiles: Array; badVersionJson: boolean; /** * When this is not empty, please use `postProcessInstallProfile` */ missingInstallDependencies: Version.NormalLibrary[]; missingBinpatch: boolean; /** * Alt for badProcessedFiles */ missingSrgJar: boolean; /** * Alt for badProcessedFiles */ missingMinecraftExtraJar: boolean; /** * Alt for badProcessedFiles */ missingForgePatchesJar: boolean; } /** * Diagnose for specific forge version. Majorly for the current installer forge. (mcversion >= 1.13) * * Don't use this with the version less than 1.13 * @param versionOrProfile If the version string present, it will try to find the installer profile under version folder. Otherwise it will use presented installer profile to diagnose * @param minecraft The minecraft location. */ function diagnoseForgeVersion(versionOrProfile: string | InstallProfile, minecraft: MinecraftLocation): Promise; /** * Post processing function for new forge installer (mcversion >= 1.13). You can use this with `ForgeInstaller.diagnose`. * * @param mc The minecraft location * @param proc The processor * @param java The java executor */ function postProcess(mc: MinecraftFolder, proc: InstallProfile["processors"][number], java: JavaExecutor): Promise; /** * Install for forge installer step 2 and 3. * @param version The version string or installer profile * @param minecraft The minecraft location */ function installByInstallerPartialTask(version: string | InstallProfile, minecraft: MinecraftLocation, option?: { java?: JavaExecutor; } & Installer.LibraryOption): Task; /** * Install for forge installer step 2 and 3. * @param version The version string or installer profile * @param minecraft The minecraft location */ function installByInstallerPartial(version: string | InstallProfile, minecraft: MinecraftLocation, option?: { java?: JavaExecutor; } & Installer.LibraryOption): Promise; /** * Install forge to target location. * Installation task for forge with mcversion >= 1.13 requires java installed on your pc. * @param version The forge version meta */ function install(version: VersionMeta, minecraft: MinecraftLocation, option?: { maven?: string; forceCheckDependencies?: boolean; java?: JavaExecutor; tempDir?: string; clearTempDirAfterInstall?: boolean; }): Promise; /** * Install forge to target location. * Installation task for forge with mcversion >= 1.13 requires java installed on your pc. * @param version The forge version meta */ function installTask(version: VersionMeta, minecraft: MinecraftLocation, option?: { maven?: string; forceInstallDependencies?: boolean; java?: JavaExecutor; tempDir?: string; clearTempDirAfterInstall?: boolean; } & Installer.LibraryOption): Task; } export * from "./forgeweb"; export default ForgeInstaller;