Skip to content

Commit b8261c4

Browse files
committed
Fix access widener not converting to access transformer on NeoForge
1 parent 046b72a commit b8261c4

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

build.gradle.kts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ val testmod by sourceSets.creating {
5353
runtimeClasspath += sourceSets.main.get().runtimeClasspath
5454
}
5555

56+
val accessWidenerName = "yacl.accesswidener"
5657
loom {
57-
accessWidenerPath.set(rootProject.file("src/main/resources/yacl.accesswidener"))
58+
accessWidenerPath.set(rootProject.file("src/main/resources/$accessWidenerName"))
5859

5960
runConfigs.all {
6061
ideConfigGenerated(false)
@@ -228,13 +229,21 @@ java {
228229
sourceCompatibility = JavaVersion.VERSION_17
229230
}
230231

231-
tasks.withType<JavaCompile> {
232-
options.release.set(findProperty("java.version")!!.toString().toInt())
233-
}
232+
tasks {
233+
withType<JavaCompile> {
234+
options.release.set(findProperty("java.version")!!.toString().toInt())
235+
}
234236

235-
tasks.withType<KotlinCompile> {
236-
kotlinOptions {
237-
jvmTarget = findProperty("java.version")!!.toString()
237+
withType<KotlinCompile> {
238+
kotlinOptions {
239+
jvmTarget = findProperty("java.version")!!.toString()
240+
}
241+
}
242+
243+
remapJar {
244+
if (isNeoforge) {
245+
atAccessWideners.add(accessWidenerName)
246+
}
238247
}
239248
}
240249

0 commit comments

Comments
 (0)