Add support for mod loading on Forge 1.13.

This commit is contained in:
Daniel Scalzi 2019-02-18 18:17:31 -05:00
parent 81367bc619
commit e08c3a903a
No known key found for this signature in database
GPG Key ID: D18EA3FB4B142A57
4 changed files with 60 additions and 6 deletions

View File

@ -1547,6 +1547,26 @@
} }
] ]
},
{
"id": "squeek:appleskin:1.0.9",
"name": "AppleSkin (test mod)",
"type": "ForgeMod",
"artifact": {
"size": 26613,
"MD5": "ada2e02e0cc3267f5d927805332c4c8b",
"url": ""
}
},
{
"id": "com.blamejared:controlling:4.0.1",
"name": "Controlling (Test Mod)",
"type": "ForgeMod",
"artifact": {
"size": 34914,
"MD5": "b4dc10b9039518ce00845ca962e6a136",
"url": ""
}
} }
] ]
} }

View File

@ -41,12 +41,21 @@ class ProcessBuilder {
this.setupLiteLoader() this.setupLiteLoader()
logger.log('Using liteloader:', this.usingLiteLoader) logger.log('Using liteloader:', this.usingLiteLoader)
const modObj = this.resolveModConfiguration(ConfigManager.getModConfiguration(this.server.getID()).mods, this.server.getModules()) const modObj = this.resolveModConfiguration(ConfigManager.getModConfiguration(this.server.getID()).mods, this.server.getModules())
// Mod list below 1.13
if(!AssetGuard.mcVersionAtLeast('1.13', this.server.getMinecraftVersion())){
this.constructModList('forge', modObj.fMods, true) this.constructModList('forge', modObj.fMods, true)
if(this.usingLiteLoader){ if(this.usingLiteLoader){
this.constructModList('liteloader', modObj.lMods, true) this.constructModList('liteloader', modObj.lMods, true)
} }
}
const uberModArr = modObj.fMods.concat(modObj.lMods) const uberModArr = modObj.fMods.concat(modObj.lMods)
const args = this.constructJVMArguments(uberModArr, tempNativePath) let args = this.constructJVMArguments(uberModArr, tempNativePath)
if(AssetGuard.mcVersionAtLeast('1.13', this.server.getMinecraftVersion())){
args = args.concat(this.constructModArguments(modObj.fMods))
}
logger.log('Launch Arguments:', args) logger.log('Launch Arguments:', args)
@ -233,6 +242,29 @@ class ProcessBuilder {
return modList return modList
} }
/**
* Construct the mod argument list for forge 1.13
*
* @param {Array.<Object>} mods An array of mods to add to the mod list.
*/
constructModArguments(mods){
const argStr = mods.map(mod => {
return mod.getExtensionlessID()
}).join(',')
if(argStr){
return [
'--fml.mavenRoots',
path.join('..', '..', 'common', 'modstore'),
'--fml.mods',
argStr
]
} else {
return []
}
}
/** /**
* Construct the argument array that will be passed to the JVM process. * Construct the argument array that will be passed to the JVM process.
* *
@ -300,6 +332,8 @@ class ProcessBuilder {
// JVM Arguments First // JVM Arguments First
let args = this.versionData.arguments.jvm let args = this.versionData.arguments.jvm
//args.push('-Dlog4j.configurationFile=D:\\WesterosCraft\\game\\common\\assets\\log_configs\\client-1.12.xml')
// Java Arguments // Java Arguments
if(process.platform === 'darwin'){ if(process.platform === 'darwin'){
args.push('-Xdock:name=WesterosCraft') args.push('-Xdock:name=WesterosCraft')

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "westeroscraftlauncher", "name": "westeroscraftlauncher",
"version": "1.5.2", "version": "1.6.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "westeroscraftlauncher", "name": "westeroscraftlauncher",
"version": "1.5.2", "version": "1.6.0",
"productName": "WesterosCraft Launcher", "productName": "WesterosCraft Launcher",
"description": "Modded Minecraft Launcher", "description": "Modded Minecraft Launcher",
"author": "Daniel Scalzi (https://github.com/dscalzi/)", "author": "Daniel Scalzi (https://github.com/dscalzi/)",