diff --git a/build-logic/src/main/kotlin/Versions.kt b/build-logic/src/main/kotlin/Versions.kt index 6170e0fb..23f7188c 100644 --- a/build-logic/src/main/kotlin/Versions.kt +++ b/build-logic/src/main/kotlin/Versions.kt @@ -19,7 +19,7 @@ object Versions { const val adventureApi = "4.9.3" const val adventurePlatform = "4.0.1" const val paperApi = "1.16.5-R0.1-SNAPSHOT" - const val velocityApi = "1.1.0" + const val velocityApi = "3.1.0" const val spongeApi7 = "7.3.0" const val jetbrainsAnnotations = "23.0.0" const val guava = "21.0-jre" diff --git a/cloud-minecraft/cloud-velocity/build.gradle.kts b/cloud-minecraft/cloud-velocity/build.gradle.kts index 7e221505..49e7d657 100644 --- a/cloud-minecraft/cloud-velocity/build.gradle.kts +++ b/cloud-minecraft/cloud-velocity/build.gradle.kts @@ -1,3 +1,7 @@ +java { + disableAutoTargetJvm() +} + dependencies { api(projects.cloudCore) api(projects.cloudBrigadier) diff --git a/examples/example-velocity/build.gradle.kts b/examples/example-velocity/build.gradle.kts index fb0f7ee5..4a420b6b 100644 --- a/examples/example-velocity/build.gradle.kts +++ b/examples/example-velocity/build.gradle.kts @@ -3,6 +3,10 @@ plugins { id("cloud.example-conventions") } +indra { + javaVersions().target(11) // Velocity 3 requires Java 11 +} + val velocityRunClasspath by configurations.creating { attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class, Usage.JAVA_RUNTIME)) @@ -35,7 +39,9 @@ tasks { group = "cloud" description = "Spin up a Velocity server environment" standardInput = System.`in` - javaLauncher.set(project.javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) }) + if (JavaVersion.current() < JavaVersion.VERSION_11) { + javaLauncher.set(project.javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) }) + } inputs.files(pluginJar) @@ -64,5 +70,5 @@ dependencies { api(project(":cloud-minecraft-extras")) api(project(":cloud-annotations")) annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi)) - velocityRunClasspath("com.velocitypowered", "velocity-proxy", "3.0.0") + velocityRunClasspath("com.velocitypowered", "velocity-proxy", Versions.velocityApi) }