Skip to content

Commit 8a156ab

Browse files
committed
fix refmaps on forge
Signed-off-by: Octol1ttle <[email protected]>
1 parent 174f18a commit 8a156ab

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

build.gradle.kts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ modstitch {
9595
// true, it will automatically be generated.
9696
addMixinsToModManifest = true
9797

98-
configs.register("flightassistant.client") { side = CLIENT }
98+
configs.register(mod.id) { side = CLIENT }
9999

100100
// Most of the time you wont ever need loader specific mixins.
101101
// If you do, simply make the mixin file and add it like so for the respective loader:
@@ -138,13 +138,16 @@ yamlang {
138138

139139
// Resources
140140
tasks.processResources {
141+
inputs.property("loader", loader)
141142
inputs.property("mod_id", mod.id)
142143
inputs.property("mod_version", mod.version)
143144
inputs.property("mod_name", mod.name)
144145
inputs.property("mc", minecraftVersionRange)
145146

147+
val loader = inputs.properties["loader"]
148+
val modId = inputs.properties["mod_id"]
146149
val map = mapOf(
147-
"mod_id" to inputs.properties["mod_id"],
150+
"mod_id" to modId,
148151
"mod_version" to inputs.properties["mod_version"],
149152
"mod_name" to inputs.properties["mod_name"],
150153
"mc" to inputs.properties["mc"],
@@ -157,6 +160,9 @@ tasks.processResources {
157160
filesMatching("fabric.mod.json") { expandOrExclude(loader == "fabric", map) }
158161
filesMatching("META-INF/mods.toml") { expandOrExclude(loader == "forge", map) }
159162
filesMatching("META-INF/neoforge.mods.toml") { expandOrExclude(loader == "neoforge", map) }
163+
filesMatching("${modId}.mixins.json") { expand(mapOf("refmap" to if (loader == "forge") """
164+
,"refmap": "${modId}.refmap.json"
165+
""".trimIndent() else ""))}
160166
}
161167

162168
// Publishing

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ stonecutter {
3030
fun mc(version: String, vararg loaders: String) {
3131
for (it in loaders) vers("$version-$it", version)
3232
}
33-
mc("1.20.1", "fabric"/*, "forge"*/)
33+
mc("1.20.1", "fabric", "forge")
3434
mc("1.21.1", "fabric", "neoforge")
3535
mc("1.21.4", "fabric")
3636
mc("1.21.5", "fabric")

src/main/resources/flightassistant.client.mixins.json renamed to src/main/resources/flightassistant.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020
"injectors": {
2121
"defaultRequire": 1
2222
}
23+
${refmap}
2324
}

0 commit comments

Comments
 (0)