Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
fix: NeoForge metadata breaking change
Browse files Browse the repository at this point in the history
Thanks Neo, sometime I hate how you works :)

REF: https://neoforged.net/news/20.5release/
  • Loading branch information
null2264 committed Apr 24, 2024
1 parent 93936d4 commit ed60ede
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ dependencies {

shadowJar {
zip64 true
exclude(isFabric ? "META-INF/mods.toml" : "fabric.mod.json")
if (isFabric) {
exclude("META-INF/mods.toml")
exclude("META-INF/neoforge.mods.toml")
} else if (isForge) {
exclude("fabric.mod.json")
exclude((isNeo && mcVersion >= 12005) ? "META-INF/mods.toml" : "META-INF/neoforge.mods.toml")
}
exclude("architectury.common.json")

configurations = [project.configurations.shade]
Expand Down Expand Up @@ -125,7 +131,14 @@ tasks.processResources {
inputs.property "mcversion", metadataMCVersion
filteringCharset "UTF-8"

filesMatching(isFabric ? "fabric.mod.json" : "META-INF/mods.toml") {
def metadataFilename = ""
if (isFabric) {
metadataFilename = "fabric.mod.json"
} else if (isForge) {
metadataFilename = (isNeo && mcVersion >= 12005) ? "META-INF/neoforge.mods.toml" : "META-INF/mods.toml"
}

filesMatching(metadataFilename) {
expand "version": metadataVersion, "mcversion": metadataMCVersion, "forge": (isNeo ? "neoforge" : "forge")
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ modId = "minecraft"
mandatory = true
versionRange = "${mcversion}"
ordering = "NONE"
side = "BOTH"
side = "BOTH"
30 changes: 30 additions & 0 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
modLoader = "javafml"
loaderVersion = "[1,)"
license = "unlicense"
issueTrackerURL = "https://github.com/null2264/LibreExpFix/issues"

[[mods]]
modId = "libreexpfix"
version = "${version}"
displayName = "LibreExpFix"
displayURL = "https://github.com/null2264/LibreExpFix"
logoFile = "icon.png"
authors = "null2264"
description = "Fix experience bug after teleporting across dimension"

[[mixins]]
config = "libreexpfix.mixins.json"

[[dependencies.libreexpfix]]
modId = "neoforge"
mandatory = true
versionRange = "[1,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.libreexpfix]]
modId = "minecraft"
mandatory = true
versionRange = "${mcversion}"
ordering = "NONE"
side = "BOTH"

0 comments on commit ed60ede

Please sign in to comment.