From 990f7daeb7673f4e2fd4582b51d5092b14e95fcb Mon Sep 17 00:00:00 2001 From: sulu5890 Date: Tue, 13 Jul 2021 21:49:38 -0500 Subject: [PATCH] Fix incorrect message for outdated clients (#6160) --- ...ncorrect-message-for-outdated-client.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/server/0727-Fix-incorrect-message-for-outdated-client.patch diff --git a/patches/server/0727-Fix-incorrect-message-for-outdated-client.patch b/patches/server/0727-Fix-incorrect-message-for-outdated-client.patch new file mode 100644 index 0000000000..318e078f3c --- /dev/null +++ b/patches/server/0727-Fix-incorrect-message-for-outdated-client.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: sulu5890 +Date: Sun, 11 Jul 2021 19:34:03 -0500 +Subject: [PATCH] Fix incorrect message for outdated client + + +diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +index e0cd786f130e34b3401d40663e1548fc0076f74a..6de604675a5f41a12f6daa093fc15f22732dba58 100644 +--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +@@ -81,7 +81,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL + if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { + Component chatmessage; // Paper - Fix hex colors not working in some kick messages + +- if (packet.getProtocolVersion() < 754) { ++ if (packet.getProtocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Paper - Fix incorrect message for outdated clients + chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages + } else { + chatmessage = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages