Skip to content

Commit

Permalink
(common) fix refmap conflict between neoforge and fabric
Browse files Browse the repository at this point in the history
THE MOD IS FINALLY DONE
  • Loading branch information
lilgallon committed Oct 1, 2024
1 parent 420a85e commit 13a4716
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ subprojects {

base {
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
archivesName = "$rootProject.archives_name-$project.name-MC$rootProject.minecraft_version"
archivesName = "$rootProject.archives_name-$project.name"
}

repositories {
Expand All @@ -33,10 +33,6 @@ subprojects {

loom {
silentMojangMappingsLicense()
mixin {
useLegacyMixinAp = true
defaultRefmapName.set("horsestatsmod-refmap.json")
}
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions common/src/main/resources/horsestatsmod.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
],
"injectors": {
"defaultRequire": 1
},
"refmap": "horsestatsmod-refmap.json"
}${refmap_fix}
}
7 changes: 7 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ processResources {

from(project(":common").sourceSets["main"].resources)

// For some reason fabric mixins won't work because refmap is not specified
// in mixins.json. AND forge won't work if refmap is specified. So in fabric
// we specify the refmap, and in forge we don't
filesMatching("horsestatsmod.mixins.json") {
expand refmap_fix: ",\n \"refmap\": \"horsestatsmod-common-common-refmap.json\""
}

filesMatching('fabric.mod.json') {
expand replaceProperties + [project: project]
}
Expand Down
7 changes: 7 additions & 0 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ processResources {

from(project(":common").sourceSets["main"].resources)

// For some reason fabric mixins won't work because refmap is not specified
// in mixins.json. AND forge won't work if refmap is specified. So in fabric
// we specify the refmap, and in forge we don't
filesMatching("horsestatsmod.mixins.json") {
expand refmap_fix: ""
}

filesMatching(['META-INF/neoforge.mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}
Expand Down
2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ modId="${mod_id}" #mandatory
version="${mod_version}" #mandatory
displayName="${mod_name}" #mandatory
authors="${mod_authors}"
description='''${mod_description}'''
description="${mod_description}"
logoFile= "${mod_id}.png"
updateJSONURL="${mod_update_json}"
displayURL="${mod_display_url}"
Expand Down

0 comments on commit 13a4716

Please sign in to comment.