From c6381e7f4d4dadc5d21de994b6e768eb9ae112e7 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Wed, 21 Aug 2024 19:58:32 +0200 Subject: [PATCH] Allow protocols to handle client intention packet (#4112) --- .../viaversion/protocols/base/InitialBaseProtocol.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 d2d5bbe5e..ae0882f53 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 @@ -128,6 +128,15 @@ public class InitialBaseProtocol extends AbstractProtocol protocols = new ArrayList<>(pipeline.pipes()); + protocols.remove(this); + wrapper.apply(Direction.SERVERBOUND, State.HANDSHAKE, protocols); + } catch (CancelException e) { + throw new RuntimeException("Cancelling the client intention packet is not allowed", e); + } + if (Via.getManager().isDebug()) { Via.getPlatform().getLogger().info("User connected with protocol: " + info.protocolVersion() + " and serverProtocol: " + info.serverProtocolVersion()); Via.getPlatform().getLogger().info("Protocol pipeline: " + pipeline.pipes());