fix: 使forge的数据生成可被共享
This commit is contained in:
parent
8a825e0c9b
commit
190c085229
|
|
@ -17,6 +17,12 @@ dependencies {
|
|||
}
|
||||
|
||||
loom {
|
||||
def commonResources = project(':common').file('src/main/resources/').getAbsolutePath().toString()
|
||||
def fabricResources = file('src/main/resources/').getAbsolutePath().toString()
|
||||
def fabricBuildResources = file('build/resources/main/').getAbsolutePath().toString()
|
||||
def commonBuildResources = project(':common').file('build/resources/main/').getAbsolutePath().toString()
|
||||
def generatedOutput = project(':common').file('src/generated/resources/').getAbsolutePath().toString()
|
||||
|
||||
if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) {
|
||||
accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener"))
|
||||
}
|
||||
|
|
@ -29,12 +35,40 @@ loom {
|
|||
setConfigName("Fabric Client")
|
||||
ideConfigGenerated(true)
|
||||
runDir("run")
|
||||
programArgs "--username", "dev"
|
||||
def args = [
|
||||
"-Dlib39.modid=${mod_id}".toString(),
|
||||
"-Dlib39.output=${generatedOutput}".toString(),
|
||||
"-Dlib39.existing.fabric=${fabricResources}".toString(),
|
||||
"-Dlib39.existing.common=${commonResources}".toString(),
|
||||
"-Dlib39.existing.fabricBuild=${fabricBuildResources}".toString(),
|
||||
"-Dlib39.existing.commonBuild=${commonBuildResources}".toString()
|
||||
]
|
||||
vmArgs.addAll(args)
|
||||
|
||||
// 也可以添加JVM参数
|
||||
vmArgs.addAll(
|
||||
"-Dfabric.log.level=info",
|
||||
"-Dmixin.debug.export=true"
|
||||
)
|
||||
}
|
||||
|
||||
server {
|
||||
server()
|
||||
serverWithGui()
|
||||
setConfigName("Fabric Server")
|
||||
ideConfigGenerated(true)
|
||||
runDir("run")
|
||||
|
||||
def args = [
|
||||
"-Dlib39.modid=${mod_id}".toString(),
|
||||
"-Dlib39.output=${generatedOutput}".toString(),
|
||||
"-Dlib39.existing.fabric=${fabricResources}".toString(),
|
||||
"-Dlib39.existing.common=${commonResources}".toString(),
|
||||
"-Dlib39.existing.fabricBuild=${fabricBuildResources}".toString(),
|
||||
"-Dlib39.existing.commonBuild=${commonBuildResources}".toString()
|
||||
]
|
||||
vmArgs.addAll(args)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ mixin {
|
|||
config("${mod_id}.mixins.json")
|
||||
config("${mod_id}.forge.mixins.json")
|
||||
}
|
||||
def commonResources = project(':common').file('src/main/resources/').getAbsolutePath()
|
||||
def forgeResources = file('src/main/resources/').getAbsolutePath()
|
||||
def forgeBuildResources = file('build/resources/main/').getAbsolutePath()
|
||||
def commonBuildResources = project(':common').file('build/resources/main/').getAbsolutePath()
|
||||
def generatedOutput = project(':common').file('src/generated/resources/').getAbsolutePath()
|
||||
|
||||
legacyForge {
|
||||
version = "${minecraft_version}-${forge_version}"
|
||||
|
|
@ -27,10 +32,29 @@ legacyForge {
|
|||
runs {
|
||||
client {
|
||||
client()
|
||||
devLogin = true
|
||||
programArguments.addAll(
|
||||
'--mod', project.mod_id,
|
||||
'--all',
|
||||
'--existing', forgeResources,
|
||||
'--existing', commonResources,
|
||||
'--existing', forgeBuildResources,
|
||||
'--existing', commonBuildResources
|
||||
)
|
||||
}
|
||||
data {
|
||||
data()
|
||||
programArguments.addAll '--mod', project.mod_id, '--all', '--output', generated.getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
|
||||
|
||||
// 使用之前定义的变量
|
||||
programArguments.addAll(
|
||||
'--mod', project.mod_id,
|
||||
'--all',
|
||||
'--output', generatedOutput,
|
||||
'--existing', forgeResources,
|
||||
'--existing', commonResources,
|
||||
'--existing', forgeBuildResources,
|
||||
'--existing', commonBuildResources
|
||||
)
|
||||
}
|
||||
server {
|
||||
server()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user