example-velocity: Run on Velocity 3, fix decorator

This commit is contained in:
zml 2021-07-07 11:39:02 -07:00 committed by Jason
parent 4b9c94279e
commit c16ee8049b
3 changed files with 15 additions and 6 deletions

View file

@ -70,7 +70,16 @@ repositories {
sonatypeSnapshots() sonatypeSnapshots()
/* Velocity, used for cloud-velocity */ /* Velocity, used for cloud-velocity */
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-release/") { 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 */ /* The Minecraft repository, used for cloud-brigadier */
maven("https://libraries.minecraft.net/") { maven("https://libraries.minecraft.net/") {

View file

@ -30,7 +30,7 @@ tasks {
} }
val pluginJar = shadowJar.map { it.outputs } val pluginJar = shadowJar.map { it.outputs }
val spongeRunFiles = velocityRunClasspath.asFileTree val velocityRunFiles = velocityRunClasspath.asFileTree
register("runVelocity", JavaExec::class) { register("runVelocity", JavaExec::class) {
group = "cloud" group = "cloud"
description = "Spin up a Velocity server environment" description = "Spin up a Velocity server environment"
@ -39,7 +39,7 @@ tasks {
inputs.files(pluginJar) inputs.files(pluginJar)
classpath(spongeRunFiles) classpath(velocityRunFiles)
workingDir = layout.projectDirectory.dir("run").asFile workingDir = layout.projectDirectory.dir("run").asFile
doFirst { doFirst {
@ -64,5 +64,5 @@ dependencies {
api(project(":cloud-minecraft-extras")) api(project(":cloud-minecraft-extras"))
api(project(":cloud-annotations")) api(project(":cloud-annotations"))
annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi)) annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi))
velocityRunClasspath("com.velocitypowered", "velocity-proxy", "1.1.3") velocityRunClasspath("com.velocitypowered", "velocity-proxy", "3.0.0")
} }

View file

@ -51,7 +51,8 @@ import java.util.function.Function;
@Plugin( @Plugin(
id = "example-plugin", id = "example-plugin",
name = "Cloud example plugin", name = "Cloud example plugin",
version = "1.2.0" authors = "Cloud Team",
version = "1.6.0"
) )
public final class ExampleVelocityPlugin { public final class ExampleVelocityPlugin {
@ -80,7 +81,6 @@ public final class ExampleVelocityPlugin {
new MinecraftExceptionHandler<CommandSource>() new MinecraftExceptionHandler<CommandSource>()
.withDefaultHandlers() .withDefaultHandlers()
.withDecorator(component -> Component.text() .withDecorator(component -> Component.text()
.color(NamedTextColor.WHITE)
.append(Component.text('[')) .append(Component.text('['))
.append(Component.text("cloud-velocity-example", TextColor.color(0x1CBAE0))) .append(Component.text("cloud-velocity-example", TextColor.color(0x1CBAE0)))
.append(Component.text("] ")) .append(Component.text("] "))