From b8261c444d27fc20b87b1e39365238e80b751005 Mon Sep 17 00:00:00 2001 From: isxander Date: Mon, 27 May 2024 14:30:25 +0100 Subject: Fix access widener not converting to access transformer on NeoForge --- build.gradle.kts | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f551c2f..9bd118d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,8 +53,9 @@ val testmod by sourceSets.creating { runtimeClasspath += sourceSets.main.get().runtimeClasspath } +val accessWidenerName = "yacl.accesswidener" loom { - accessWidenerPath.set(rootProject.file("src/main/resources/yacl.accesswidener")) + accessWidenerPath.set(rootProject.file("src/main/resources/$accessWidenerName")) runConfigs.all { ideConfigGenerated(false) @@ -228,13 +229,21 @@ java { sourceCompatibility = JavaVersion.VERSION_17 } -tasks.withType { - options.release.set(findProperty("java.version")!!.toString().toInt()) -} +tasks { + withType { + options.release.set(findProperty("java.version")!!.toString().toInt()) + } -tasks.withType { - kotlinOptions { - jvmTarget = findProperty("java.version")!!.toString() + withType { + kotlinOptions { + jvmTarget = findProperty("java.version")!!.toString() + } + } + + remapJar { + if (isNeoforge) { + atAccessWideners.add(accessWidenerName) + } } } -- cgit