2020-07-06 04:38:18 +02:00
|
|
|
--- a/net/minecraft/network/Varint21FrameDecoder.java
|
|
|
|
+++ b/net/minecraft/network/Varint21FrameDecoder.java
|
2024-12-14 21:47:45 +01:00
|
|
|
@@ -41,6 +_,12 @@
|
2020-07-06 04:38:18 +02:00
|
|
|
|
2024-12-14 21:47:45 +01:00
|
|
|
@Override
|
|
|
|
protected void decode(ChannelHandlerContext context, ByteBuf in, List<Object> out) {
|
2020-07-06 04:38:18 +02:00
|
|
|
+ // Paper start - Perf: Optimize exception handling; if channel is not active just discard the packet
|
2024-12-14 21:47:45 +01:00
|
|
|
+ if (!context.channel().isActive()) {
|
|
|
|
+ in.skipBytes(in.readableBytes());
|
2020-07-06 04:38:18 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end - Perf: Optimize exception handling
|
2024-12-14 21:47:45 +01:00
|
|
|
in.markReaderIndex();
|
2020-07-06 04:38:18 +02:00
|
|
|
this.helperBuf.clear();
|
2024-12-14 21:47:45 +01:00
|
|
|
if (!copyVarint(in, this.helperBuf)) {
|