From 732fd90d48ee94f97cecb40bc264da03c928cdbe Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 18 Mar 2022 23:31:25 -0400 Subject: [PATCH] Missed instance of Outdated server --- .../java/JavaLoginDisconnectTranslator.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java index 981fa83bf..7fca689b0 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaLoginDisconnectTranslator.java @@ -37,6 +37,8 @@ import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; import org.geysermc.geyser.translator.text.MessageTranslator; +import java.util.List; + @Translator(packet = ClientboundLoginDisconnectPacket.class) public class JavaLoginDisconnectTranslator extends PacketTranslator { @@ -44,7 +46,7 @@ public class JavaLoginDisconnectTranslator extends PacketTranslator children = component.children(); + for (int i = 0; i < children.size(); i++) { + if (children.get(i) instanceof TextComponent child && child.content().startsWith("Outdated server!")) { + // Reproduced on Paper 1.17.1 + isOutdatedMessage = true; + break; + } + } + } + } } String serverDisconnectMessage = MessageTranslator.convertMessage(disconnectReason, session.getLocale());