mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Check if the channel is open in BukkitEncodeHandler
This commit is contained in:
parent
04e572fa30
commit
8edad67394
@ -43,7 +43,8 @@ public final class BukkitEncodeHandler extends MessageToMessageEncoder<ByteBuf>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void encode(final ChannelHandlerContext ctx, final ByteBuf bytebuf, final List<Object> out) throws Exception {
|
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);
|
throw CancelEncoderException.generate(null);
|
||||||
}
|
}
|
||||||
if (!connection.shouldTransformPacket()) {
|
if (!connection.shouldTransformPacket()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user