From 50f0be767c69f3ac49c3a2c4c8669354a39fd9b3 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 12 May 2021 20:41:38 +0100 Subject: Update to 21w19a and Java 16 This commit can be used as an example on how to update your mod to Java 16. You will need to ensure you have Java 16 installed and set as the active version to run this. Gradle 7 is required along with loom 0.8 --- build.gradle | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index a4b5de7..f807b77 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ plugins { - id 'fabric-loom' version '0.6-SNAPSHOT' + id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_16 +targetCompatibility = JavaVersion.VERSION_16 archivesBaseName = project.archives_base_name version = project.mod_version @@ -46,13 +46,8 @@ tasks.withType(JavaCompile).configureEach { // If Javadoc is generated, this must be specified in that task too. it.options.encoding = "UTF-8" - // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too - // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. - // We'll use that if it's available, but otherwise we'll use the older option. - def targetVersion = 8 - if (JavaVersion.current().isJava9Compatible()) { - it.options.release = targetVersion - } + // Minecraft 1.17 (21w19a) upwards uses Java 16. + it.options.release = 16 } java { -- cgit 1.4.1