mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-11-05 21:23:59 +03:00
1.12.2 Forge hotfix
This commit is contained in:
parent
5e5cf5158e
commit
8812596cd4
3 changed files with 14 additions and 8 deletions
|
@ -2,7 +2,7 @@
|
|||
##### This project is complete for now.
|
||||
[![Build Status](https://travis-ci.com/Pierce01/MinecraftLauncher-core.svg?branch=master)](https://travis-ci.com/Pierce01/MinecraftLauncher-core)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
||||
![version](https://img.shields.io/badge/stable_version-3.16.0-blue)
|
||||
![version](https://img.shields.io/badge/stable_version-3.16.1-blue)
|
||||
![badge](https://img.shields.io/badge/ncurses-not_supported-purple)
|
||||
|
||||
MCLC (Minecraft Launcher Core) is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself.
|
||||
|
|
|
@ -307,6 +307,10 @@ class Handler {
|
|||
: this.options.customArgs = forgeWrapperAgrs
|
||||
}
|
||||
|
||||
isModernForge (json) {
|
||||
return json.inheritsFrom && json.inheritsFrom.split('.')[1] >= 12 && !(json.inheritsFrom === '1.12.2' && (json.id.split('.')[json.id.split('.').length - 1]) === '2847')
|
||||
}
|
||||
|
||||
async getForgedWrapped () {
|
||||
let json = null
|
||||
let installerJson = null
|
||||
|
@ -319,9 +323,11 @@ class Handler {
|
|||
if (!json.forgeWrapperVersion || !(json.forgeWrapperVersion === this.options.fw.version)) {
|
||||
this.client.emit('debug', '[MCLC]: Old ForgeWrapper has generated this version JSON, re-generating')
|
||||
} else {
|
||||
this.fwAddArgs()
|
||||
// Make MCLC treat modern forge as a custom version json rather then legacy forge.
|
||||
this.options.forge = null
|
||||
// If forge is modern, add ForgeWrappers launch arguments and set forge to null so MCLC treats it as a custom json.
|
||||
if (this.isModernForge(json)) {
|
||||
this.fwAddArgs()
|
||||
this.options.forge = null
|
||||
}
|
||||
return json
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -352,8 +358,8 @@ class Handler {
|
|||
// Holder for the specifc jar ending which depends on the specifc forge version.
|
||||
let jarEnding = 'universal'
|
||||
// We need to handle modern forge differently than legacy.
|
||||
if (json.inheritsFrom && json.inheritsFrom.split('.')[1] >= 12) {
|
||||
// If forge is modern and above 1.12, we add ForgeWrapper to the libraries so MCLC includes it in the classpaths.
|
||||
if (this.isModernForge(json)) {
|
||||
// If forge is modern and above 1.12.2, we add ForgeWrapper to the libraries so MCLC includes it in the classpaths.
|
||||
if (json.inheritsFrom !== '1.12.2') {
|
||||
this.fwAddArgs()
|
||||
const fwName = `ForgeWrapper-${this.options.fw.version}.jar`
|
||||
|
@ -440,7 +446,7 @@ class Handler {
|
|||
fs.writeFileSync(versionPath, JSON.stringify(json, null, 4))
|
||||
|
||||
// Make MCLC treat modern forge as a custom version json rather then legacy forge.
|
||||
this.options.forge = null
|
||||
if (this.isModernForge(json)) this.options.forge = null
|
||||
|
||||
return json
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "minecraft-launcher-core",
|
||||
"version": "3.16.0",
|
||||
"version": "3.16.1",
|
||||
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in a new issue