diff --git a/build.gradle.kts b/build.gradle.kts index 44c6c5f..c39006c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -87,7 +87,7 @@ subprojects { } } -val javaVer: String = "11" +val javaVer: String = "8" val kotlinVer = rootProject.property("kotlin_stdlib_version").toString() + ".0" val mcBase: String = rootProject.architectury.minecraft.dropLast(2) allprojects { @@ -103,9 +103,13 @@ allprojects { **/ apply(plugin = "java") apply(plugin = "architectury-plugin") + java { + sourceCompatibility = JavaVersion.VERSION_11 + } dependencies { implementation(kotlin("stdlib-jdk8", kotlinVer)) implementation(kotlin("reflect", kotlinVer)) + annotationProcessor("com.github.bsideup.jabel:jabel-javac-plugin:0.3.0") } tasks { withType(ShadowJar::class) { @@ -126,7 +130,7 @@ allprojects { withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { with(kotlinOptions) { freeCompilerArgs = listOf("-Xjvm-default=all", "-Xlambdas=indy") - jvmTarget = javaVer + jvmTarget = if (javaVer.toInt() < 10) "1.$javaVer" else javaVer languageVersion = "1.5" apiVersion = rootProject.property("kotlin_stdlib_version").toString() } @@ -134,7 +138,9 @@ allprojects { withType(JavaCompile::class) { with(options) { encoding = "UTF-8" - release.set(javaVer.toInt()); isFork = true + isFork = true + // The following lines are required for Jabel: + compilerArgs.addAll(listOf("-Xplugin:jabel", "--release", javaVer)) } } withType(net.fabricmc.loom.task.RemapJarTask::class) { diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt index 8578039..59324ad 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt @@ -20,5 +20,5 @@ annotation class ButtonInfo( }; enum class Category(val translationKey: String, val categoryColor: Colors) { MISC("snowy.clickbox.misc", Colors.BLUE), RISKY("snowy.clickbox.risky", Colors.RED); - init { ClickGui.components.add(ClickBox(y = 0.0, name = TranslatableComponent(translationKey))) } + init { ClickGui.components.add(ClickBox(y = 0.0, name = TranslatableComponent(translationKey), color = categoryColor)) } } diff --git a/common/src/main/resources/snowygui-mixins.json b/common/src/main/resources/snowygui-mixins.json index 2f5b07c..1fe9d0c 100644 --- a/common/src/main/resources/snowygui-mixins.json +++ b/common/src/main/resources/snowygui-mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "fr.username404.snowygui.mixins", - "compatibilityLevel": "JAVA_11", + "compatibilityLevel": "JAVA_8", "client": [ "KeysAccessor", "KeyMappings", diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e5338d3..0f80bbf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists