From 2296a9d8dd613c2c15a5acb50576549a46d77973 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 16 Jul 2020 11:50:48 -0400 Subject: [PATCH] Fix compile error caused by adventure changes --- .../java/com/velocitypowered/api/event/ResultedEvent.java | 2 +- .../proxy/protocol/netty/GS4QueryHandler.java | 2 +- .../proxy/protocol/packet/LegacyDisconnect.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java b/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java index 66bd15a69..cbc6d273f 100644 --- a/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/ResultedEvent.java @@ -108,7 +108,7 @@ public interface ResultedEvent { return "allowed"; } if (reason != null) { - return "denied: " + PlainComponentSerializer.INSTANCE.serialize(reason); + return "denied: " + PlainComponentSerializer.plain().serialize(reason); } return "denied"; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java index 8487785ce..6ca9d42e9 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java @@ -72,7 +72,7 @@ public class GS4QueryHandler extends SimpleChannelInboundHandler private QueryResponse createInitialResponse() { return QueryResponse.builder() - .hostname(PlainComponentSerializer.INSTANCE.serialize(server.getConfiguration().getMotd())) + .hostname(PlainComponentSerializer.plain().serialize(server.getConfiguration().getMotd())) .gameVersion(ProtocolVersion.SUPPORTED_VERSION_STRING) .map(server.getConfiguration().getQueryMap()) .currentPlayers(server.getPlayerCount()) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LegacyDisconnect.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LegacyDisconnect.java index 5d6a4a2bf..43b58b614 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LegacyDisconnect.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/LegacyDisconnect.java @@ -12,7 +12,8 @@ public class LegacyDisconnect { private static final ServerPing.Players FAKE_PLAYERS = new ServerPing.Players(0, 0, ImmutableList.of()); - private static final String LEGACY_COLOR_CODE = "\u00a7"; + private static final String LEGACY_COLOR_CODE = Character + .toString(LegacyComponentSerializer.SECTION_CHAR); private final String reason; @@ -36,7 +37,7 @@ public class LegacyDisconnect { // remove all section symbols, along with fetching just the first line of an (unformatted) // MOTD. return new LegacyDisconnect(String.join(LEGACY_COLOR_CODE, - cleanSectionSymbol(getFirstLine(PlainComponentSerializer.INSTANCE.serialize( + cleanSectionSymbol(getFirstLine(PlainComponentSerializer.plain().serialize( response.getDescriptionComponent()))), Integer.toString(players.getOnline()), Integer.toString(players.getMax())));