mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-21 17:45:36 +01:00
Reset reader before passing packet through protocols (#4117)
This commit is contained in:
parent
f8eb57cdbb
commit
33de12ceb1
@ -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<BaseClientboundPacket,
|
||||
try {
|
||||
final List<Protocol> 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();
|
||||
|
Loading…
Reference in New Issue
Block a user