From d1fbb909a54ac4114bee7034b2d2df1300ac3d97 Mon Sep 17 00:00:00 2001 From: Kas-tle <26531652+Kas-tle@users.noreply.github.com> Date: Tue, 12 Jul 2022 17:09:48 +0000 Subject: [PATCH] fixed java 16 thanks to @davchoo --- bootstrap/spigot/build.gradle.kts | 14 ++++++++++++-- build-logic/build.gradle.kts | 2 +- .../main/kotlin/geyser.base-conventions.gradle.kts | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bootstrap/spigot/build.gradle.kts b/bootstrap/spigot/build.gradle.kts index 123ef06f2..5a12ded01 100644 --- a/bootstrap/spigot/build.gradle.kts +++ b/bootstrap/spigot/build.gradle.kts @@ -9,6 +9,18 @@ dependencies { implementation("org.geysermc.geyser.adapters", "spigot-all", adaptersVersion) implementation("me.lucko", "commodore", commodoreVersion) + + // Both paper-api and paper-mojangapi only provide Java 17 versions for 1.19 + compileOnly("io.papermc.paper", "paper-api", paperVersion) { + attributes { + attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17) + } + } + compileOnly("io.papermc.paper", "paper-mojangapi", paperVersion) { + attributes { + attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17) + } + } } platformRelocate("it.unimi.dsi.fastutil") @@ -19,8 +31,6 @@ platformRelocate("me.lucko.commodore") platformRelocate("io.netty.channel.kqueue") // These dependencies are already present on the platform -provided("io.papermc.paper", "paper-api", paperVersion) -provided("io.papermc.paper", "paper-mojangapi", paperVersion) provided("com.viaversion", "viaversion", viaVersion) application { diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index dc8d6d620..25cbfe9de 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -16,6 +16,6 @@ dependencies { tasks.withType { kotlinOptions { - jvmTarget = "17" + jvmTarget = "16" } } \ No newline at end of file diff --git a/build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts b/build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts index b4cc63deb..2ea5d88a4 100644 --- a/build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/geyser.base-conventions.gradle.kts @@ -26,8 +26,8 @@ tasks { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_16 + targetCompatibility = JavaVersion.VERSION_16 withSourcesJar() } \ No newline at end of file