From 33de12ceb1300f3f0013ef9ff69cdf17505be1c1 Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:42:50 +0200 Subject: [PATCH] Reset reader before passing packet through protocols (#4117) --- .../viaversion/protocols/base/InitialBaseProtocol.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/base/InitialBaseProtocol.java b/common/src/main/java/com/viaversion/viaversion/protocols/base/InitialBaseProtocol.java index 648da9406..2c990c75c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/base/InitialBaseProtocol.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/base/InitialBaseProtocol.java @@ -40,7 +40,6 @@ import com.viaversion.viaversion.protocol.version.BaseVersionProvider; import com.viaversion.viaversion.protocols.base.packet.BaseClientboundPacket; import com.viaversion.viaversion.protocols.base.packet.BasePacketTypesProvider; import com.viaversion.viaversion.protocols.base.packet.BaseServerboundPacket; - import java.util.ArrayList; import java.util.List; @@ -137,6 +136,7 @@ public class InitialBaseProtocol extends AbstractProtocol protocols = new ArrayList<>(pipeline.pipes()); protocols.removeAll(alreadyAdded); // Skip all manually added protocols to prevent double handling + wrapper.resetReader(); wrapper.apply(Direction.SERVERBOUND, State.HANDSHAKE, protocols); } catch (CancelException e) { wrapper.cancel();