3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 14:50:08 +01:00
Paper/Spigot-Server-Patches/0034-Improve-Network-Manager-packet-handling.patch
2014-11-28 15:01:21 -06:00

29 Zeilen
1.1 KiB
Diff

From cad30db92a21978282fda86eed2351308d6b05e2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 28 Nov 2014 13:12:00 -0600
Subject: [PATCH] Improve Network Manager packet handling
Removes an unnecessary "peek at head of queue"
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index e34f0f1..146ab2e 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -144,9 +144,10 @@ public class NetworkManager extends SimpleChannelInboundHandler {
private void m() {
if (this.i != null && this.i.isOpen()) {
- while (!this.h.isEmpty()) {
- QueuedPacket queuedpacket = (QueuedPacket) this.h.poll();
-
+ // PaperSpigot start - Improve Network Manager packet handling
+ QueuedPacket queuedpacket;
+ while ((queuedpacket = (QueuedPacket) this.h.poll()) != null) {
+ // PaperSpigot end
this.a(QueuedPacket.a(queuedpacket), QueuedPacket.b(queuedpacket));
}
--
1.9.1