From 396f4e490031e28b1748e2d31d8066d944a428d4 Mon Sep 17 00:00:00 2001 From: Konicai <71294714+Konicai@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:45:45 -0400 Subject: [PATCH] Update latency translator for 1.20.10 (#3993) --- .../org/geysermc/geyser/network/GameProtocol.java | 4 ++++ .../BedrockNetworkStackLatencyTranslator.java | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java index abaea2c2b..d15a33315 100644 --- a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java +++ b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java @@ -87,6 +87,10 @@ public final class GameProtocol { return session.getUpstream().getProtocolVersion() < Bedrock_v589.CODEC.getProtocolVersion(); } + public static boolean isPre1_20_10(GeyserSession session) { + return session.getUpstream().getProtocolVersion() < Bedrock_v594.CODEC.getProtocolVersion(); + } + /** * Gets the {@link PacketCodec} for Minecraft: Java Edition. * diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java index 7e5643d45..0fe272ea9 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockNetworkStackLatencyTranslator.java @@ -31,6 +31,7 @@ import org.cloudburstmc.protocol.bedrock.packet.NetworkStackLatencyPacket; import org.cloudburstmc.protocol.bedrock.packet.UpdateAttributesPacket; import org.geysermc.floodgate.util.DeviceOs; import org.geysermc.geyser.entity.attribute.GeyserAttributeType; +import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.session.GeyserSession; import org.geysermc.geyser.translator.protocol.PacketTranslator; import org.geysermc.geyser.translator.protocol.Translator; @@ -50,10 +51,15 @@ public class BedrockNetworkStackLatencyTranslator extends PacketTranslator