-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move from
SingleThreadEventLoop
to AbstractThreadEventLoop
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,22 +22,22 @@ Locally this patch drops the entity tracker tick by a full 1.5x. | |
Co-authored-by: Quang Tran <[email protected]> | ||
|
||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java | ||
index 2ae08b21c63490bbf8cd870f9585d82ed131f815..435df4a71e19b84706d318d73cb11c1f82955251 100644 | ||
index 2ae08b21c63490bbf8cd870f9585d82ed131f815..a437257a7178fb5a272fc8d0941948c1fc72682f 100644 | ||
--- a/src/main/java/net/minecraft/network/Connection.java | ||
+++ b/src/main/java/net/minecraft/network/Connection.java | ||
@@ -148,6 +148,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { | ||
this.stopReadingPackets = true; | ||
} | ||
// Paper end - packet limiter | ||
+ private io.netty.channel.SingleThreadEventLoop executor; // Paper - optimise packets that are not flushed | ||
+ private io.netty.channel.AbstractEventLoop eventLoop; // Paper - optimise packets that are not flushed | ||
|
||
public Connection(PacketFlow side) { | ||
this.receiving = side; | ||
@@ -156,6 +157,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { | ||
public void channelActive(ChannelHandlerContext channelhandlercontext) throws Exception { | ||
super.channelActive(channelhandlercontext); | ||
this.channel = channelhandlercontext.channel(); | ||
+ this.executor = (io.netty.channel.SingleThreadEventLoop) this.channel.eventLoop(); // Paper - optimise packets that are not flushed | ||
+ this.eventLoop = (io.netty.channel.AbstractEventLoop) this.channel.eventLoop(); // Paper - optimise packets that are not flushed | ||
this.address = this.channel.remoteAddress(); | ||
// Spigot Start | ||
this.preparing = false; | ||
|
@@ -47,7 +47,7 @@ index 2ae08b21c63490bbf8cd870f9585d82ed131f815..435df4a71e19b84706d318d73cb11c1f | |
} else { | ||
+ // Paper start - optimise packets that are not flushed | ||
+ if (!flush) { | ||
+ this.executor.lazyExecute(() -> this.doSendPacket(packet, callbacks, flush)); | ||
+ this.eventLoop.lazyExecute(() -> this.doSendPacket(packet, callbacks, flush)); | ||
+ } else | ||
+ // Paper end - optimise packets that are not flushed | ||
this.channel.eventLoop().execute(() -> { | ||
|