diff --git a/README.md b/README.md index 054570d..269a3f6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ⏳ Advanced PlayTime Plugin [![Build Status](https://github.com/imDMK/AdvancedPlayTime/actions/workflows/gradle.yml/badge.svg)](https://github.com/imDMK/AdvancedPlayTime/actions/workflows/gradle.yml) -![JDK](https://img.shields.io/badge/JDK-25-blue.svg) +![JDK](https://img.shields.io/badge/JDK-21%2B-blue.svg) ![Supported versions](https://img.shields.io/badge/Minecraft-1.21--26.2-green.svg) [![SpigotMC](https://img.shields.io/badge/SpigotMC-yellow.svg)](https://www.spigotmc.org/resources/%E2%8F%B0%EF%B8%8F-advancedplaytime-1-21-1-21-10.130458/) [![Modrinth](https://img.shields.io/badge/Modrinth-1bd96a.svg)](https://modrinth.com/plugin/advancedplaytime) @@ -14,7 +14,7 @@ --- ### 📦 Requirements -- **Java 25** or newer on the server. +- **Java 21** or newer on the server. - **Spigot / Paper 1.21 – 26.2**. ### ✨ Key Features diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index e445c89..d194382 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -1,7 +1,14 @@ object Versions { - /** Java release the plugin is compiled for and requires at runtime. */ - const val JAVA = 25 + /** JDK the project is built with. */ + const val JAVA_TOOLCHAIN = 25 + + /** + * Bytecode level of the shipped plugin, and therefore the oldest JVM a server may + * run it on. Kept at 21 because that is what Minecraft 1.21 itself requires — a + * higher target would lock the plugin out of the low end of the supported range. + */ + const val JAVA_RELEASE = 21 /** Spigot API the plugin is compiled against (newest supported server). */ const val SPIGOT_API = "26.2-R0.1-SNAPSHOT" diff --git a/buildSrc/src/main/kotlin/playtime-java.gradle.kts b/buildSrc/src/main/kotlin/playtime-java.gradle.kts index 3336939..c79e5f5 100644 --- a/buildSrc/src/main/kotlin/playtime-java.gradle.kts +++ b/buildSrc/src/main/kotlin/playtime-java.gradle.kts @@ -6,11 +6,11 @@ group = "com.github.imdmk" version = "3.0.2" java { - toolchain.languageVersion.set(JavaLanguageVersion.of(Versions.JAVA)) + toolchain.languageVersion.set(JavaLanguageVersion.of(Versions.JAVA_TOOLCHAIN)) } tasks.withType().configureEach { options.compilerArgs = listOf("-Xlint:deprecation", "-parameters") options.encoding = "UTF-8" - options.release.set(Versions.JAVA) + options.release.set(Versions.JAVA_RELEASE) } diff --git a/playtime-plugin/build.gradle.kts b/playtime-plugin/build.gradle.kts index 4eb2380..6920070 100644 --- a/playtime-plugin/build.gradle.kts +++ b/playtime-plugin/build.gradle.kts @@ -30,7 +30,7 @@ playTimeShadow { } shadowJar { - archiveFileName.set("AdvancedPlayTime v${project.version} (MC 1.21-26.2, Java ${Versions.JAVA}).jar") + archiveFileName.set("AdvancedPlayTime v${project.version} (MC 1.21-26.2, Java ${Versions.JAVA_RELEASE}).jar") mergeServiceFiles()