diff --git a/README.md b/README.md index f05e694..443d31b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/components/handler.js b/components/handler.js index 455fb36..c0f5626 100644 --- a/components/handler.js +++ b/components/handler.js @@ -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 } diff --git a/package.json b/package.json index 8866b55..5efe810 100644 --- a/package.json +++ b/package.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": {