update toolchain to Java 16

This commit is contained in:
gnembon committed 2021-05-12 22:48:44 -03:00
1 parent 1b0fc3202f
commit f5db84345e
5 files changed
+28 -22

No files matched your search

+18 -12
View File
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.5-SNAPSHOT'
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
}
@@ -18,7 +18,7 @@ dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
// modCompile "net.fabricmc:fabric:${project.fabric_version}"
@@ -31,14 +31,17 @@ dependencies {
processResources {
inputs.property "version", project.version
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.mod_version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
//from(sourceSets.main.resources.srcDirs) {
// include "fabric.mod.json"
// expand "version": project.mod_version
//}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
//from(sourceSets.main.resources.srcDirs) {
// exclude "fabric.mod.json"
//}
}
@@ -52,10 +55,13 @@ tasks.withType(JavaCompile).configureEach {
// 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
}
//def targetVersion = 8
//if (JavaVersion.current().isJava9Compatible()) {
// it.options.release = targetVersion
//}
// Minecraft 1.17 (21w19a) upwards uses Java 16.
//it.options.release = 16
}
java {