3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Reset reader before passing packet through protocols (#4117)

Dieser Commit ist enthalten in:
RK_01 2024-08-23 09:42:50 +02:00 committet von GitHub
Ursprung f8eb57cdbb
Commit 33de12ceb1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -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.BaseClientboundPacket;
import com.viaversion.viaversion.protocols.base.packet.BasePacketTypesProvider; import com.viaversion.viaversion.protocols.base.packet.BasePacketTypesProvider;
import com.viaversion.viaversion.protocols.base.packet.BaseServerboundPacket; import com.viaversion.viaversion.protocols.base.packet.BaseServerboundPacket;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -137,6 +136,7 @@ public class InitialBaseProtocol extends AbstractProtocol<BaseClientboundPacket,
try { try {
final List<Protocol> protocols = new ArrayList<>(pipeline.pipes()); final List<Protocol> protocols = new ArrayList<>(pipeline.pipes());
protocols.removeAll(alreadyAdded); // Skip all manually added protocols to prevent double handling protocols.removeAll(alreadyAdded); // Skip all manually added protocols to prevent double handling
wrapper.resetReader();
wrapper.apply(Direction.SERVERBOUND, State.HANDSHAKE, protocols); wrapper.apply(Direction.SERVERBOUND, State.HANDSHAKE, protocols);
} catch (CancelException e) { } catch (CancelException e) {
wrapper.cancel(); wrapper.cancel();