From eb3868d91185c88e0fe4a0738fc5965de04b87ee Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 21 Dec 2020 19:56:11 -0500 Subject: [PATCH] Do not try to override colors in messages or server-sent messages --- .../proxy/connection/client/ConnectedPlayer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 653325c5f..55d8df8b4 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 @@ -569,7 +569,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { logger.error("{}: kicked from server {}: {}", this, server.getServerInfo().getName(), plainTextReason); handleConnectionException(server, disconnectReason, Component.text() - .append(messages.getKickPrefix(server.getServerInfo().getName())) + .append(messages.getKickPrefix(server.getServerInfo().getName()) + .colorIfAbsent(NamedTextColor.RED)) .color(NamedTextColor.RED) .append(disconnectReason) .build(), safe); @@ -577,8 +578,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { logger.error("{}: disconnected while connecting to {}: {}", this, server.getServerInfo().getName(), plainTextReason); handleConnectionException(server, disconnectReason, Component.text() - .append(messages.getDisconnectPrefix(server.getServerInfo().getName())) - .color(NamedTextColor.RED) + .append(messages.getDisconnectPrefix(server.getServerInfo().getName()) + .colorIfAbsent(NamedTextColor.RED)) .append(disconnectReason) .build(), safe); }