diff --git a/README.md b/README.md index e4e4c3e..0306097 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # SnowyGUI -This mod requires fabric-language-kotlin on fabric, and kotlinforforge on forge. \ No newline at end of file +This mod requires fabric-language-kotlin on fabric, kotlinforforge on forge **and also needs Java 14 or higher**. \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 89c9dd7..691a77f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -86,6 +86,7 @@ subprojects { } } +val javaVer: String = "14" val kotlinVer = rootProject.property("kotlin_stdlib_version").toString() + ".0" val mcBase: String = rootProject.architectury.minecraft.dropLast(2) allprojects { @@ -105,8 +106,8 @@ allprojects { implementation(kotlin("stdlib-jdk8", kotlinVer)) } java { - targetCompatibility = JavaVersion.VERSION_1_8 - sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_14 + sourceCompatibility = JavaVersion.VERSION_14 } tasks { withType(ShadowJar::class) { @@ -127,7 +128,7 @@ allprojects { withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { with(kotlinOptions) { freeCompilerArgs = listOf("-Xjvm-default=all", "-Xlambdas=indy") - jvmTarget = "1.8" + jvmTarget = javaVer languageVersion = "1.5" apiVersion = rootProject.property("kotlin_stdlib_version").toString() } @@ -135,9 +136,7 @@ allprojects { withType(JavaCompile::class) { with(options) { encoding = "UTF-8" - if (JavaVersion.current().isJava9Compatible) { - release.set(8) - }; isFork = true + release.set(javaVer.toInt()); isFork = true } } withType(net.fabricmc.loom.task.RemapJarTask::class) { @@ -157,6 +156,7 @@ allprojects { val modProperties = mapOf( "mod_version" to (rootProject.version as String), "minecraft_version" to mcBase, + "java_version" to javaVer, "mod_group" to this@allprojects.group, "fabric_kotlin" to rootProject.property("fabric_language_kotlin"), "kotlinforforge" to rootProject.property("kotlinforforge") diff --git a/common/src/main/resources/snowygui-mixins.json b/common/src/main/resources/snowygui-mixins.json index 1fe9d0c..f8df476 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_8", + "compatibilityLevel": "JAVA_14", "client": [ "KeysAccessor", "KeyMappings", diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 67650bd..6bce513 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -31,13 +31,14 @@ "snowygui-mixins.json" ], "depends": { - "fabricloader": ">=0.9.3", + "fabricloader": ">=0.11.0", "fabric-language-kotlin": ">=${fabric_kotlin}", "fabric-resource-loader-v0": "*", "fabric-rendering-v1": "*", "minecraft": ">=${minecraft_version}" }, "breaks": { + "java": "<${java_version}", "modmenu": "<1.15.0" }, "suggests": {