From 6e00dbe2b7cff470c8d728f9d64af792afbbc115 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 14 Oct 2020 16:08:20 -0400 Subject: [PATCH] Fix compile errors --- api/build.gradle | 2 +- build.gradle | 3 ++- .../proxy/command/builtin/GlistCommand.java | 4 ++-- .../proxy/command/builtin/VelocityCommand.java | 4 ++-- .../proxy/connection/client/ConnectedPlayer.java | 8 ++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index a2c07338a..4a7fd9130 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -31,7 +31,7 @@ dependencies { api "net.kyori:adventure-text-serializer-gson:${adventureVersion}" api "net.kyori:adventure-text-serializer-legacy:${adventureVersion}" api "net.kyori:adventure-text-serializer-plain:${adventureVersion}" - api "net.kyori:adventure-text-serializer-legacy-text3:${adventureVersion}" + api "net.kyori:adventure-text-serializer-legacy-text3:${adventurePlatformVersion}" api "org.slf4j:slf4j-api:${slf4jVersion}" api 'com.google.inject:guice:4.2.3' diff --git a/build.gradle b/build.gradle index 1f41da8da..ac901337f 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,8 @@ allprojects { ext { // dependency versions textVersion = '3.0.4' - adventureVersion = '4.0.0-SNAPSHOT' + adventureVersion = '4.0.0' + adventurePlatformVersion = '4.0.0-SNAPSHOT' junitVersion = '5.7.0' slf4jVersion = '1.7.30' log4jVersion = '2.13.3' diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/GlistCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/GlistCommand.java index f3b930ea0..ca1677a90 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/GlistCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/GlistCommand.java @@ -104,7 +104,7 @@ public class GlistCommand { } TextComponent.Builder builder = Component.text() - .append(TextComponent.of("[" + server.getServerInfo().getName() + "] ", + .append(Component.text("[" + server.getServerInfo().getName() + "] ", NamedTextColor.DARK_AQUA)) .append(Component.text("(" + onServer.size() + ")", NamedTextColor.GRAY)) .append(Component.text(": ")) @@ -112,7 +112,7 @@ public class GlistCommand { for (int i = 0; i < onServer.size(); i++) { Player player = onServer.get(i); - builder.append(player.getUsername()); + builder.append(Component.text(player.getUsername())); if (i + 1 < onServer.size()) { builder.append(Component.text(", ")); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java index db5714b2b..02c085241 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/VelocityCommand.java @@ -187,8 +187,8 @@ public class VelocityCommand implements SimpleCommand { .color(NamedTextColor.DARK_AQUA) .append(Component.text(version.getVersion()).decoration(TextDecoration.BOLD, false)) .build(); - TextComponent copyright = TextComponent - .of("Copyright 2018-2020 " + version.getVendor() + ". " + version.getName() + TextComponent copyright = Component + .text("Copyright 2018-2020 " + version.getVendor() + ". " + version.getName() + " is freely licensed under the terms of the MIT License."); source.sendMessage(Identity.nil(), velocity); source.sendMessage(Identity.nil(), copyright); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 92bdc6778..9672f3918 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -630,7 +630,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { getProtocolVersion()), ((Impl) status).isSafe()); break; case SUCCESS: - sendMessage(server.getConfiguration().getMessages() + sendMessage(Identity.nil(), server.getConfiguration().getMessages() .getMovedToNewServerPrefix().append(friendlyReason)); break; default: @@ -641,7 +641,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { } else if (event.getResult() instanceof Notify) { Notify res = (Notify) event.getResult(); if (event.kickedDuringServerConnect() && previouslyConnected) { - sendMessage(res.getMessageComponent()); + sendMessage(Identity.nil(), res.getMessageComponent()); } else { disconnect(res.getMessageComponent()); } @@ -981,10 +981,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { switch (status.getStatus()) { case ALREADY_CONNECTED: - sendMessage(ConnectionMessages.ALREADY_CONNECTED); + sendMessage(Identity.nil(), ConnectionMessages.ALREADY_CONNECTED); break; case CONNECTION_IN_PROGRESS: - sendMessage(ConnectionMessages.IN_PROGRESS); + sendMessage(Identity.nil(), ConnectionMessages.IN_PROGRESS); break; case CONNECTION_CANCELLED: // Ignored; the plugin probably already handled this.