Forge-installer Module
This is a sub-module belong to minecraft-launcher-core module. You can still use this individually.
New Forge Installing process
The module have three stage for installing new forge (mcversion >= 1.13)
- Deploy forge installer jar
- Download installer jar
- Extract forge universal jar files in installer jar into
.minecraft/libraries
- Extract
version.json
into target version folder,.minecraft/versions/<ver>/<ver>.json
- Extract
installer_profile.json
into target version folder,.minecraft/versions/<ver>/installer_profile.json
- Download Dependencies
- Merge libraires in
installer_profile.json
and<ver>.json
- Download them
- Merge libraires in
- Post processing forge jar
- Parse
installer_profile.json
- Get the processors info and execute all of them.
- Parse
The ForgeInstaller.install
will do all of them.
The ForgeInstaller.installByInstallerPartial
will do 2 and 3.
If you want to just do step 3, you can use ForgeInstaller.diagnose
and find which libraries is break and use ForgeInstaller.postProcess
to handle it.
Usage
Forge Installation
Get the forge version info and install forge from it.
import { ForgeInstaller, ForgeWebPage } from "@xmcl/forge-installer";
import { MinecraftLocation } from "@xmcl/util";
const page: ForgeWebPage = await ForgeWebPage.getWebPage();
const minecraftLocation: MinecraftLocation;
const mcversion = page.mcversion; // mc version
const firstVersionOnPage: ForgeWebPage.Version = page.versions[0];
await ForgeInstaller.install(firstVersionOnPage, minecraftLocation);
Notice that this installation doesn't ensure full libraries installation.
Please run Installer.installDependencies
afther that.
The new 1.13 forge installation process requires java to run.
Either you have java
executable in your environment variable PATH,
or you can assign java location by ForgeInstaller.install(forgeVersionMeta, minecraftLocation, { java: yourJavaExecutablePath });
.
If you use this auto installation process to install forge, please checkout Lex's Patreon. Consider support him to maintains forge.