This commit is contained in:
SrGooglo 2024-01-28 20:09:41 +01:00
parent 3258796af5
commit 86236db834

View File

@ -1,6 +1,6 @@
import fs from "node:fs" import fs from "node:fs"
import path from "node:path" import path from "node:path"
import {EventEmitter} from "events" import { EventEmitter } from "events"
import child from "child_process" import child from "child_process"
import Handler from "./handler" import Handler from "./handler"
@ -215,6 +215,7 @@ export default class MCLCore extends EventEmitter {
startMinecraft(launchArguments) { startMinecraft(launchArguments) {
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, detached: this.options.overrides.detached }) { 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.stdout.on('data', (data) => this.emit('data', data.toString('utf-8')))
minecraft.stderr.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)) minecraft.on('close', (code) => this.emit('close', code))