Skip to content

Commit

Permalink
Fix Java version for forge only template
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Nov 28, 2021
1 parent d885fca commit 62646f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions generator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"COMPILE_JAVA_16": " options.release = 16",
"COMPILE_JAVA_8_ARCH": "\n // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too\n // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.\n // We'll use that if it's available, but otherwise we'll use the older option.\n def targetVersion = 8\n if (JavaVersion.current().isJava9Compatible()) {\n options.release = targetVersion\n }",
"COMPILE_JAVA_16_ARCH": " options.release = 16",
"JAVA_8": "VERSION_8",
"JAVA_16": "VERSION_16",
"FABRIC_LOADER": {
"filter": ".*",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml"
Expand All @@ -17,6 +19,7 @@
],
"tokens": {
"MINECRAFT": "1.16.5",
"JAVA_VERSION": "#JAVA_8",
"COMPILE_JAVA": "#COMPILE_JAVA_8",
"MCMETA_FORMAT": "6",
"JEI_MAJOR": "7",
Expand All @@ -39,6 +42,7 @@
],
"tokens": {
"MINECRAFT": "1.16.5",
"JAVA_VERSION": "#JAVA_8",
"COMPILE_JAVA": "#COMPILE_JAVA_8_ARCH",
"FABRIC_LOADER": "#FABRIC_LOADER",
"LOOM_FORGE_EXT": "",
Expand Down Expand Up @@ -84,6 +88,7 @@
],
"tokens": {
"MINECRAFT": "1.17.1",
"JAVA_VERSION": "#JAVA_16",
"COMPILE_JAVA": "#COMPILE_JAVA_16",
"MCMETA_FORMAT": "7",
"JEI_MAJOR": "8",
Expand All @@ -106,6 +111,7 @@
],
"tokens": {
"MINECRAFT": "1.17.1",
"JAVA_VERSION": "#JAVA_16",
"COMPILE_JAVA": "#COMPILE_JAVA_16_ARCH",
"FABRIC_LOADER": "#FABRIC_LOADER",
"LOOM_FORGE_EXT": "",
Expand Down
9 changes: 3 additions & 6 deletions templates/forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
plugins {
id 'dev.architectury.loom' version '0.10.0-SNAPSHOT'
id 'maven-publish'
id "dev.architectury.loom" version "0.10.0-SNAPSHOT"
id "maven-publish"
}

// when using loom 0.10.0 with minecraft 1.16,
// be sure to set this (and other references to Java 16)
// to Java 8, obviously
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = targetCompatibility = JavaVersion.@JAVA_VERSION@

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand Down

0 comments on commit 62646f3

Please sign in to comment.