diff --git a/Spigot-Server-Patches/0143-Avoid-blocking-on-Network-Manager-creation.patch b/Spigot-Server-Patches/0143-Avoid-blocking-on-Network-Manager-creation.patch index 6b49a47093..ff3308958f 100644 --- a/Spigot-Server-Patches/0143-Avoid-blocking-on-Network-Manager-creation.patch +++ b/Spigot-Server-Patches/0143-Avoid-blocking-on-Network-Manager-creation.patch @@ -1,4 +1,4 @@ -From 657ccc96c1093a23903aad6575111bc6fa51bd59 Mon Sep 17 00:00:00 2001 +From b08b9267a815bb5ed31fc5f94479dd3b54c529a2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 23:19:16 -0400 Subject: [PATCH] Avoid blocking on Network Manager creation @@ -6,10 +6,10 @@ Subject: [PATCH] Avoid blocking on Network Manager creation Per Paper issue 294 diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 6a71ebb..5cde4be 100644 +index 6a71ebb..faf7b60 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -60,6 +60,17 @@ public class ServerConnection { +@@ -60,6 +60,15 @@ public class ServerConnection { public volatile boolean d; private final List g = Collections.synchronizedList(Lists.newArrayList()); private final List h = Collections.synchronizedList(Lists.newArrayList()); @@ -17,17 +17,15 @@ index 6a71ebb..5cde4be 100644 + private final List pending = Collections.synchronizedList(Lists.newArrayList()); + private void addPending() { + synchronized (pending) { -+ synchronized (this.h) { // Paper - OBFHELPER - List of network managers -+ this.h.addAll(pending); -+ pending.clear(); -+ } ++ this.h.addAll(pending); // Paper - OBFHELPER - List of network managers ++ pending.clear(); + } + } + // Paper end public ServerConnection(MinecraftServer minecraftserver) { this.f = minecraftserver; -@@ -94,7 +105,7 @@ public class ServerConnection { +@@ -94,7 +103,7 @@ public class ServerConnection { channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND)); NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND); @@ -36,7 +34,7 @@ index 6a71ebb..5cde4be 100644 channel.pipeline().addLast("packet_handler", networkmanager); networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.f, networkmanager)); } -@@ -123,6 +134,7 @@ public class ServerConnection { +@@ -123,6 +132,7 @@ public class ServerConnection { synchronized (this.h) { // Spigot Start