Order the launch arguments better.

Classpath -> JVM -> Main Class -> Liteloader -> Minecraft ->
Client Options -> Mod list
This commit is contained in:
Daniel Scalzi 2019-02-14 20:22:12 -05:00
parent 6b96770c98
commit c834ca971a
No known key found for this signature in database
GPG Key ID: D18EA3FB4B142A57

View File

@ -241,20 +241,26 @@ class ProcessBuilder {
*/ */
constructJVMArguments(mods, tempNativePath){ constructJVMArguments(mods, tempNativePath){
let args = ['-Xmx' + ConfigManager.getMaxRAM(), let args = []
'-Xms' + ConfigManager.getMinRAM(),
'-Djava.library.path=' + tempNativePath,
'-cp',
this.classpathArg(mods, tempNativePath).join(process.platform === 'win32' ? ';' : ':'),
this.forgeData.mainClass]
// Classpath Argument
args.push('-cp')
args.push(this.classpathArg(mods, tempNativePath).join(process.platform === 'win32' ? ';' : ':'))
// Java Arguments
if(process.platform === 'darwin'){ if(process.platform === 'darwin'){
args.unshift('-Xdock:name=WesterosCraft') args.push('-Xdock:name=WesterosCraft')
args.unshift('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns')) args.push('-Xdock:icon=' + path.join(__dirname, '..', 'images', 'minecraft.icns'))
} }
args.push('-Xmx' + ConfigManager.getMaxRAM())
args.push('-Xms' + ConfigManager.getMinRAM())
args = args.concat(ConfigManager.getJVMOptions())
args.push('-Djava.library.path=' + tempNativePath)
args.splice(2, 0, ...ConfigManager.getJVMOptions()) // Main Java Class
args.push(this.forgeData.mainClass)
// Forge Arguments
args = args.concat(this._resolveForgeArgs()) args = args.concat(this._resolveForgeArgs())
return args return args
@ -298,7 +304,7 @@ class ProcessBuilder {
val = this.authUser.accessToken val = this.authUser.accessToken
break break
case 'user_type': case 'user_type':
val = 'MOJANG' val = 'mojang'
break break
case 'version_type': case 'version_type':
val = this.versionData.type val = this.versionData.type
@ -309,36 +315,41 @@ class ProcessBuilder {
} }
} }
} }
mcArgs.push('--modListFile')
mcArgs.push('absolute:' + this.fmlDir)
if(this.usingLiteLoader){ // Autoconnect to the selected server.
mcArgs.push('--modRepo') if(ConfigManager.getAutoConnect() && this.server.isAutoConnect()){
mcArgs.push(this.llDir) const serverURL = new URL('my://' + this.server.getAddress())
mcArgs.push('--server')
mcArgs.unshift('com.mumfrey.liteloader.launch.LiteLoaderTweaker') mcArgs.push(serverURL.hostname)
mcArgs.unshift('--tweakClass') if(serverURL.port){
mcArgs.push('--port')
mcArgs.push(serverURL.port)
}
} }
// Prepare game resolution // Prepare game resolution
if(ConfigManager.getFullscreen()){ if(ConfigManager.getFullscreen()){
mcArgs.unshift('--fullscreen') mcArgs.push('--fullscreen')
mcArgs.push(true)
} else { } else {
mcArgs.unshift(ConfigManager.getGameWidth()) mcArgs.push('--width')
mcArgs.unshift('--width') mcArgs.push(ConfigManager.getGameWidth())
mcArgs.unshift(ConfigManager.getGameHeight()) mcArgs.push('--height')
mcArgs.unshift('--height') mcArgs.push(ConfigManager.getGameHeight())
} }
// Mod List File Argument
mcArgs.push('--modListFile')
mcArgs.push('absolute:' + this.fmlDir)
// Prepare autoconnect // LiteLoader
if(ConfigManager.getAutoConnect() && this.server.isAutoConnect()){ if(this.usingLiteLoader){
const serverURL = new URL('my://' + this.server.getAddress()) mcArgs.push('--modRepo')
mcArgs.unshift(serverURL.hostname) mcArgs.push(this.llDir)
mcArgs.unshift('--server')
if(serverURL.port){ // Set first arg to liteloader tweak class
mcArgs.unshift(serverURL.port) mcArgs.unshift('com.mumfrey.liteloader.launch.LiteLoaderTweaker')
mcArgs.unshift('--port') mcArgs.unshift('--tweakClass')
}
} }
return mcArgs return mcArgs