From c16ee8049bd38051055ecaea87c48bfe74f8d8ba Mon Sep 17 00:00:00 2001 From: zml Date: Wed, 7 Jul 2021 11:39:02 -0700 Subject: [PATCH] example-velocity: Run on Velocity 3, fix decorator --- .../src/main/kotlin/cloud.base-conventions.gradle.kts | 11 ++++++++++- examples/example-velocity/build.gradle.kts | 6 +++--- .../examples/velocity/ExampleVelocityPlugin.java | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/build-logic/src/main/kotlin/cloud.base-conventions.gradle.kts b/build-logic/src/main/kotlin/cloud.base-conventions.gradle.kts index 129761ae..0da04e4c 100644 --- a/build-logic/src/main/kotlin/cloud.base-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/cloud.base-conventions.gradle.kts @@ -70,7 +70,16 @@ repositories { sonatypeSnapshots() /* Velocity, used for cloud-velocity */ maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-release/") { - mavenContent { releasesOnly() } + mavenContent { + releasesOnly() + includeGroup("com.velocitypowered") + } + } + maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/") { + mavenContent { + snapshotsOnly() + includeGroup("com.velocitypowered") + } } /* The Minecraft repository, used for cloud-brigadier */ maven("https://libraries.minecraft.net/") { diff --git a/examples/example-velocity/build.gradle.kts b/examples/example-velocity/build.gradle.kts index 2e1c6ee7..fb0f7ee5 100644 --- a/examples/example-velocity/build.gradle.kts +++ b/examples/example-velocity/build.gradle.kts @@ -30,7 +30,7 @@ tasks { } val pluginJar = shadowJar.map { it.outputs } - val spongeRunFiles = velocityRunClasspath.asFileTree + val velocityRunFiles = velocityRunClasspath.asFileTree register("runVelocity", JavaExec::class) { group = "cloud" description = "Spin up a Velocity server environment" @@ -39,7 +39,7 @@ tasks { inputs.files(pluginJar) - classpath(spongeRunFiles) + classpath(velocityRunFiles) workingDir = layout.projectDirectory.dir("run").asFile doFirst { @@ -64,5 +64,5 @@ dependencies { api(project(":cloud-minecraft-extras")) api(project(":cloud-annotations")) annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi)) - velocityRunClasspath("com.velocitypowered", "velocity-proxy", "1.1.3") + velocityRunClasspath("com.velocitypowered", "velocity-proxy", "3.0.0") } diff --git a/examples/example-velocity/src/main/java/cloud/commandframework/examples/velocity/ExampleVelocityPlugin.java b/examples/example-velocity/src/main/java/cloud/commandframework/examples/velocity/ExampleVelocityPlugin.java index 70b33e41..0f19ce76 100644 --- a/examples/example-velocity/src/main/java/cloud/commandframework/examples/velocity/ExampleVelocityPlugin.java +++ b/examples/example-velocity/src/main/java/cloud/commandframework/examples/velocity/ExampleVelocityPlugin.java @@ -51,7 +51,8 @@ import java.util.function.Function; @Plugin( id = "example-plugin", name = "Cloud example plugin", - version = "1.2.0" + authors = "Cloud Team", + version = "1.6.0" ) public final class ExampleVelocityPlugin { @@ -80,7 +81,6 @@ public final class ExampleVelocityPlugin { new MinecraftExceptionHandler() .withDefaultHandlers() .withDecorator(component -> Component.text() - .color(NamedTextColor.WHITE) .append(Component.text('[')) .append(Component.text("cloud-velocity-example", TextColor.color(0x1CBAE0))) .append(Component.text("] "))