3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-03 22:18:04 +02:00

Check if the channel is open in BukkitEncodeHandler

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-03-02 20:13:58 +01:00
Ursprung 04e572fa30
Commit 8edad67394
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -43,7 +43,8 @@ public final class BukkitEncodeHandler extends MessageToMessageEncoder<ByteBuf>
@Override
protected void encode(final ChannelHandlerContext ctx, final ByteBuf bytebuf, final List<Object> out) throws Exception {
if (!connection.checkClientboundPacket()) {
// Check if the channel is open as older servers might start sending packets through the pipeline despite the channel being closed
if (!connection.checkClientboundPacket() || !ctx.channel().isOpen()) {
throw CancelEncoderException.generate(null);
}
if (!connection.shouldTransformPacket()) {