From 1c6cc01682c1030978875faaaf1d2c5c5b0c4d69 Mon Sep 17 00:00:00 2001 From: Corentin Grall Date: Tue, 7 Apr 2020 15:36:06 +0200 Subject: [PATCH 1/4] Added --customLaunchArgs options (#40) * Added --customLaunchArgs options - #39 * Fixed Typo Co-authored-by: Pierce --- README.md | 3 ++- components/handler.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 623a440..adefc2a 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ launcher.on('data', (e) => console.log(e)); | `options.installer` | String | Path to installer being executed. | False | | `options.root` | String | Path where you want the launcher to work in. like `C:/Users/user/AppData/Roaming/.mc`, | True | | `options.os` | String | windows, osx or linux. MCLC will auto determine the OS if this field isn't provided. | False | -| `options.customArgs` | Array | Array of custom java arguments you want to add. | False | +| `options.customLaunchArgs`| Array | Array of custom Minecraft arguments you want to add. | False | +| `options.customArgs` | Array | Array of custom Java arguments you want to add. | False | | `options.version.number` | String | Minecraft version that is going to be launched. | True | | `options.version.type` | String | Any string. The actual Minecraft launcher uses `release` and `snapshot`. | True | | `options.version.custom` | String | The name of the folder, jar file, and version json in the version folder. | False | diff --git a/components/handler.js b/components/handler.js index 7b53686..793e46f 100644 --- a/components/handler.js +++ b/components/handler.js @@ -514,7 +514,7 @@ class Handler { '--proxyPass', this.options.proxy.password ); - + if(this.options.customLaunchArgs) args.concat(this.options.customArgs) this.client.emit('debug', '[MCLC]: Set launch options'); resolve(args); }); From 8be5a5979ea256e0348e92d8ab4b821525fd7c3e Mon Sep 17 00:00:00 2001 From: Pierce Date: Tue, 7 Apr 2020 09:39:17 -0400 Subject: [PATCH 2/4] v3.13.0 --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index adefc2a..78843db 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.12.3-blue) +![version](https://img.shields.io/badge/stable_version-3.13.0-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/package.json b/package.json index f377444..ac45410 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.12.3", + "version": "3.13.0", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": { From 487bfa06fc1ea4a4ae23c8dace7221c7e2f4ccec Mon Sep 17 00:00:00 2001 From: Pierce Date: Tue, 7 Apr 2020 09:56:28 -0400 Subject: [PATCH 3/4] v3.13.1 --- README.md | 2 +- components/handler.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 78843db..a1044ab 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.13.0-blue) +![version](https://img.shields.io/badge/stable_version-3.13.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 793e46f..2ad9fe7 100644 --- a/components/handler.js +++ b/components/handler.js @@ -514,7 +514,7 @@ class Handler { '--proxyPass', this.options.proxy.password ); - if(this.options.customLaunchArgs) args.concat(this.options.customArgs) + if(this.options.customLaunchArgs) args.concat(this.options.customLaunchArgs) this.client.emit('debug', '[MCLC]: Set launch options'); resolve(args); }); diff --git a/package.json b/package.json index ac45410..f86118d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.13.0", + "version": "3.13.1", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": { From 4612107b3a87c59083976171e9e8e168eb72d0c8 Mon Sep 17 00:00:00 2001 From: Pierce Date: Wed, 29 Apr 2020 10:51:17 -0400 Subject: [PATCH 4/4] minArgs check for legacy & normal. --- README.md | 4 ++-- components/handler.js | 3 +-- package.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a1044ab..af24fb6 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.13.1-blue) +![version](https://img.shields.io/badge/stable_version-3.13.2-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. @@ -33,7 +33,6 @@ let opts = { // MCLC so you can handle auth based errors and validation! authorization: Authenticator.getAuth("username", "password"), root: "./minecraft", - os: "windows", version: { number: "1.14", type: "release" @@ -198,3 +197,4 @@ These are the people that helped out that aren't listed [here](https://github.co * [Khionu](https://github.com/khionu) - Research on how Minecraft's`natives` are handled. * [Coding-Kiwi](https://github.com/Coding-Kiwi) - Pointed out I didn't pass `clientToken` in initial authentication function. * maxbsoft - Pointed out that a certain JVM option causes OSX Minecraft to bug out. +* [NoƩ](https://github.com/NoXeDev) - Pointed out launch args weren't being passed for Forge 1.13+. diff --git a/components/handler.js b/components/handler.js index 2ad9fe7..da8d0d3 100644 --- a/components/handler.js +++ b/components/handler.js @@ -337,7 +337,6 @@ class Handler { const downloadLink = `${url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`; - if(fs.existsSync(path.join(jarPath, name))) { paths.push(`${jarPath}${path.sep}${name}`); counter = counter + 1; @@ -475,7 +474,7 @@ class Handler { const assetRoot = this.options.overrides.assetRoot || path.join(this.options.root, 'assets'); const assetPath = this.version.assets === "legacy" || this.version.assets === "pre-1.6" ? path.join(assetRoot, 'legacy') : path.join(assetRoot); - const minArgs = this.options.overrides.minArgs || 5; + const minArgs = this.options.overrides.minArgs || this.version.assets === "legacy" ? 5 : 11; if(args.length < minArgs) args = args.concat(this.version.minecraftArguments ? this.version.minecraftArguments.split(' ') : this.version.arguments.game); this.options.authorization = await Promise.resolve(this.options.authorization); diff --git a/package.json b/package.json index f86118d..a4c1911 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.13.1", + "version": "3.13.2", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": {