Skip to content

Commit

Permalink
Fix crash with mods jarjaring conditional mixins with jitpack maven
Browse files Browse the repository at this point in the history
  • Loading branch information
1foxy2 committed Oct 31, 2024
1 parent c22bbad commit 36bb755
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,30 @@ dependencies {
implementation(jarJar("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:${project.mixinsquared_version}"))
}

sourceSets.main.resources { srcDir 'src/generated/resources' }
sourceSets.main.resources { srcDir 'src/generated/resources' }

sourceSets.main.resources { srcDir 'src/generated/resources' }
tasks.register("modifyMetaData") {
def jsonFile = file('./build/generated/jarJar/META-INF/jarjar/metadata.json')
doLast {
def jsonContent = new JsonSlurper().parseText(jsonFile.text)
def newEntry = [
identifier: [
group: "com.github.Fallen-Breath.conditional-mixin",
artifact: "conditional-mixin-neoforge"
],
version: [
range: "[0.6.3,)",
artifactVersion: "0.6.3"
],
path: "META-INF/jarjar/conditional-mixin-neoforge-0.6.3.jar",
isObfuscated: false
]
jsonContent.jars << newEntry
jsonFile.text = JsonOutput.prettyPrint(JsonOutput.toJson(jsonContent))
}
}
tasks.named("jar") {
dependsOn modifyMetaData
//Files.write(getTemporaryDir().toPath().resolve("metadata.json"), MetadataIOHandler.toLines(metadata), StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE)
}

0 comments on commit 36bb755

Please sign in to comment.