From 1a4983a8b39f300b99efbb624f830753d9aa256d Mon Sep 17 00:00:00 2001 From: Pierce Date: Fri, 19 Jun 2020 22:21:00 -0400 Subject: [PATCH] [NOISSUE] Travis test, add detached. --- .travis.yml | 2 +- README.md | 5 +++-- components/launcher.js | 3 ++- package.json | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92436f7..7685259 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,2 @@ language: node_js -script: echo "npm test temporarily disabled" \ No newline at end of file +script: npm test \ No newline at end of file diff --git a/README.md b/README.md index 43273ce..8eee6ac 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.3-blue) +![version](https://img.shields.io/badge/stable_version-3.14.3-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. @@ -96,7 +96,8 @@ let opts = { directory: "", // where the Minecraft jar and version json are located. natives: "", // native directory path. assetRoot: "", - cwd: "", // working directory of the java process + cwd: "", // working directory of the java process. + detached: false, // whether or not the client is detached from the parent / launcher. classes: [], // all class paths are required if you use this. minArgs: 11, maxSockets: 2, // max sockets for downloadAsync. diff --git a/components/launcher.js b/components/launcher.js index 6c51451..543a8d4 100644 --- a/components/launcher.js +++ b/components/launcher.js @@ -9,6 +9,7 @@ class MCLCore extends EventEmitter { this.options = options this.options.root = path.resolve(this.options.root) this.options.overrides = { + detached: true, ...this.options.overrides, url: { meta: 'https://launchermeta.mojang.com', @@ -134,7 +135,7 @@ class MCLCore extends EventEmitter { this.emit('debug', `[MCLC]: Launching with arguments ${launchArguments.join(' ')}`) const minecraft = child.spawn(this.options.javaPath ? this.options.javaPath : 'java', launchArguments, - { cwd: this.options.overrides.cwd || this.options.root }) + { cwd: this.options.overrides.cwd || this.options.root, detached: this.options.overrides.detached }) minecraft.stdout.on('data', (data) => this.emit('data', data.toString('utf-8'))) minecraft.stderr.on('data', (data) => this.emit('data', data.toString('utf-8'))) minecraft.on('close', (code) => this.emit('close', code)) diff --git a/package.json b/package.json index b081da1..fe9b470 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minecraft-launcher-core", - "version": "3.14.2", + "version": "3.14.3", "description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS", "main": "index.js", "dependencies": {