From 779f828cdedd1b5fdddd753e6eb0969b9cc96173 Mon Sep 17 00:00:00 2001 From: Pierce Date: Mon, 5 Aug 2019 12:54:57 -0400 Subject: [PATCH] added cwd --- README.md | 3 ++- components/launcher.js | 3 ++- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aaa65ba..7e5aaf4 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,11 @@ let opts = { overrides: { minecraftJar: "", versionJson: "", - directory: "", // where the minecraft jar and version json are located. + directory: "", // where the Minecraft jar and version json are located. libraries: "", natives: "", assetRoot: "", + cwd: "", // working directory of the java process classes: [], // all class paths are required if you use this. minArgs: 11, } diff --git a/components/launcher.js b/components/launcher.js index f312158..a6d090f 100644 --- a/components/launcher.js +++ b/components/launcher.js @@ -113,7 +113,8 @@ class MCLCore extends EventEmitter { this.emit('arguments', launchArguments); this.emit('debug', launchArguments.join(' ')); - const minecraft = child.spawn(this.options.javaPath ? this.options.javaPath : 'java', launchArguments); + const minecraft = child.spawn(this.options.javaPath ? this.options.javaPath : 'java', launchArguments, + {cwd: this.options.overrides.cwd || this.options.root}); minecraft.stdout.on('data', (data) => this.emit('data', data)); minecraft.stderr.on('data', (data) => this.emit('data', data)); minecraft.on('close', (code) => this.emit('close', code)); diff --git a/package.json b/package.json index 9049af7..6d97fc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.7.3", + "version": "3.7.4", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": {