-
Notifications
You must be signed in to change notification settings - Fork 41
Forge Installer
Forge installation feature in this library would not work. MForge
has not been updated for a long time, and I will not update this anymore unless someone make pull requests. Forge installation is complex and require a lot of effort to maintain. Futhermore, Forge development team does not want anyone to make automated installation tool.
The message in forge intsaller:
Please do not automate the download and installation of Forge.
Our efforts are supported by ads from the download page.
If you MUST automate this, please consider supporting the project through https://www.patreon.com/LexManos
The recommend way is to download forge installer from official forge website and install it manually.
If you need forge installation feature in your launcher:
- Extract forge files.
- Upload extracted forge files into your file server or bundle it into your launcher.
- Write codes that copy extracted forge files into game directory.
Or, make your own forge installer code.
- Delete
.minecraft
directory - Launch vanilla version of forge that you want to extract using official mojang launcher. (not thrid party launcher including CmlLib.Core launcher)
- Install forge using official forge installer.
- In
.minecraft
directory, copylibraries
directory andversions/<forge-version-name>
directory. These two directory is extracted forge files.
Example:
<root>
|- libraries
| |- org
| |- net
| |- (many other directories)
|
|- versions
|- <forge-version-name>
|- <forge-version-name>.json
|- <forge-version-name>.jar
NOTE: some forge version does not have <forge-version-name>.jar file. it's okay
After installing forge, you can get version name of installed forge using launcher.GetAllVersions()
or await launcher.GetAllVersionsAsync()
. (reference).
Launch game using forge version name.
var process = await launcher.CreateProcess("forge-version-name", options);
process.Start();
Example 1.12.2-forge-14.23.5.2855
:
var process = await launcher.CreateProcess("1.12.2-forge-14.23.5.2855", new MLaunchOption
{
Session = MSession.GetOfflineSession("hello"),
MaximumRamMb = 4096
});
process.Start();