added cwd

This commit is contained in:
Pierce 2019-08-05 12:54:57 -04:00
parent 22baef8735
commit 779f828cde
3 changed files with 5 additions and 3 deletions

View file

@ -81,10 +81,11 @@ let opts = {
overrides: { overrides: {
minecraftJar: "", minecraftJar: "",
versionJson: "", versionJson: "",
directory: "", // where the minecraft jar and version json are located. directory: "", // where the Minecraft jar and version json are located.
libraries: "", libraries: "",
natives: "", natives: "",
assetRoot: "", assetRoot: "",
cwd: "", // working directory of the java process
classes: [], // all class paths are required if you use this. classes: [], // all class paths are required if you use this.
minArgs: 11, minArgs: 11,
} }

View file

@ -113,7 +113,8 @@ class MCLCore extends EventEmitter {
this.emit('arguments', launchArguments); this.emit('arguments', launchArguments);
this.emit('debug', launchArguments.join(' ')); 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.stdout.on('data', (data) => this.emit('data', data));
minecraft.stderr.on('data', (data) => this.emit('data', data)); minecraft.stderr.on('data', (data) => this.emit('data', data));
minecraft.on('close', (code) => this.emit('close', code)); minecraft.on('close', (code) => this.emit('close', code));

View file

@ -1,6 +1,6 @@
{ {
"name": "minecraft-launcher-core", "name": "minecraft-launcher-core",
"version": "3.7.3", "version": "3.7.4",
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {