Fixed old bug with argument splicing in processbuilder.

This commit is contained in:
Daniel Scalzi 2018-04-15 01:26:40 -04:00
parent 9448b9b5a3
commit 6e8d4fe9bc
No known key found for this signature in database
GPG Key ID: 5CA2F145B63535F9

View File

@ -110,7 +110,7 @@ class ProcessBuilder {
constructJVMArguments(mods, tempNativePath){ constructJVMArguments(mods, tempNativePath){
let args = ['-Xmx' + ConfigManager.getMaxRAM(), let args = ['-Xmx' + ConfigManager.getMaxRAM(),
'-Xms' + ConfigManager.getMinRAM(),, '-Xms' + ConfigManager.getMinRAM(),
'-Djava.library.path=' + tempNativePath, '-Djava.library.path=' + tempNativePath,
'-cp', '-cp',
this.classpathArg(mods, tempNativePath).join(process.platform === 'win32' ? ';' : ':'), this.classpathArg(mods, tempNativePath).join(process.platform === 'win32' ? ';' : ':'),
@ -121,10 +121,7 @@ class ProcessBuilder {
args.unshift('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns')) args.unshift('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns'))
} }
// For some reason this will add an undefined value unless args.splice(2, 0, ...ConfigManager.getJVMOptions())
// the delete count is 1. I suspect this is unintended behavior
// by the function.. need to keep an eye on this.
args.splice(2, 1, ...ConfigManager.getJVMOptions())
args = args.concat(this._resolveForgeArgs()) args = args.concat(this._resolveForgeArgs())