net/minecraft/network/

This commit is contained in:
Owen1212055
2024-12-14 15:47:45 -05:00
parent b0f627d7bb
commit 93c74cf2f4
6 changed files with 149 additions and 237 deletions

View File

@@ -0,0 +1,15 @@
--- 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)) {