Skip to content

Commit

Permalink
1.20.5 snapshot jdk21 JAVA_COMPATIBILITY
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Apr 4, 2024
1 parent 85a334f commit 458bbbd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ dependencies {
String MIXIN_CONFIG_PATH = 'template_mod.mixins.json'
String LANG_DIR = 'assets/template_mod/lang'
JavaVersion JAVA_COMPATIBILITY
if (mcVersion >= 11800) {
if (mcVersion >= 12005) {
JAVA_COMPATIBILITY = JavaVersion.VERSION_21
} else if (mcVersion >= 11800) {
JAVA_COMPATIBILITY = JavaVersion.VERSION_17
} else if (mcVersion >= 11700) {
JAVA_COMPATIBILITY = JavaVersion.VERSION_16
} else {
JAVA_COMPATIBILITY = JavaVersion.VERSION_1_8
}

// mixin does not support java 21 yet
JavaVersion MIXIN_COMPATIBILITY_LEVEL = JAVA_COMPATIBILITY
if (MIXIN_COMPATIBILITY_LEVEL.ordinal() > JavaVersion.VERSION_17.ordinal()) {
MIXIN_COMPATIBILITY_LEVEL = JavaVersion.VERSION_17
}

loom {
runConfigs.configureEach {
// to make sure it generates all "Minecraft Client (:subproject_name)" applications
Expand Down Expand Up @@ -113,7 +121,7 @@ processResources {
}

filesMatching(MIXIN_CONFIG_PATH) {
filter { s -> s.replace('{{COMPATIBILITY_LEVEL}}', "JAVA_${JAVA_COMPATIBILITY.ordinal() + 1}") }
filter { s -> s.replace('{{COMPATIBILITY_LEVEL}}', "JAVA_${MIXIN_COMPATIBILITY_LEVEL.ordinal() + 1}") }
}
}

Expand Down

0 comments on commit 458bbbd

Please sign in to comment.