mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
15 lines
638 B
Diff
15 lines
638 B
Diff
--- a/net/minecraft/network/Varint21FrameDecoder.java
|
|
+++ b/net/minecraft/network/Varint21FrameDecoder.java
|
|
@@ -41,6 +_,12 @@
|
|
|
|
@Override
|
|
protected void decode(ChannelHandlerContext context, ByteBuf in, List<Object> out) {
|
|
+ // Paper start - Perf: Optimize exception handling; if channel is not active just discard the packet
|
|
+ if (!context.channel().isActive()) {
|
|
+ in.skipBytes(in.readableBytes());
|
|
+ return;
|
|
+ }
|
|
+ // Paper end - Perf: Optimize exception handling
|
|
in.markReaderIndex();
|
|
this.helperBuf.clear();
|
|
if (!copyVarint(in, this.helperBuf)) {
|