3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-24 15:20:35 +01:00

Fixed Legacy Ping handling (#1180)

Dieser Commit ist enthalten in:
Adrian 2024-01-11 01:57:03 -05:00 committet von GitHub
Ursprung 408b420af7
Commit cc906000bc
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -362,8 +362,17 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
ensureInEventLoop();
this.state = state;
this.channel.pipeline().get(MinecraftEncoder.class).setState(state);
this.channel.pipeline().get(MinecraftDecoder.class).setState(state);
// If the connection is LEGACY (<1.6), the decoder and encoder are not set.
final MinecraftEncoder minecraftEncoder = this.channel.pipeline()
.get(MinecraftEncoder.class);
if (minecraftEncoder != null) {
minecraftEncoder.setState(state);
}
final MinecraftDecoder minecraftDecoder = this.channel.pipeline()
.get(MinecraftDecoder.class);
if (minecraftDecoder != null) {
minecraftDecoder.setState(state);
}
if (state == StateRegistry.CONFIG) {
// Activate the play packet queue