diff --git a/Spigot-Server-Patches/0395-ChunkMapDistance-CME.patch b/Spigot-Server-Patches/0395-ChunkMapDistance-CME.patch index a7a81b416..4bc703dc2 100644 --- a/Spigot-Server-Patches/0395-ChunkMapDistance-CME.patch +++ b/Spigot-Server-Patches/0395-ChunkMapDistance-CME.patch @@ -1,37 +1,47 @@ -From 75d7f6aa1662e91a24593022180ba867cbbabca0 Mon Sep 17 00:00:00 2001 +From 4edf0cf5fcd69d7b5fc89c185144706f2de35667 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 29 May 2019 04:01:22 +0100 Subject: [PATCH] ChunkMapDistance CME diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index ed4e8d69ca..cd18150488 100644 +index ed4e8d69ca..f72843119a 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -36,7 +36,7 @@ public abstract class ChunkMapDistance { +@@ -23,6 +23,7 @@ import it.unimi.dsi.fastutil.objects.ObjectSortedSet; + import java.util.Set; + import java.util.concurrent.CompletableFuture; + import java.util.concurrent.Executor; ++ + import javax.annotation.Nullable; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -36,7 +37,7 @@ public abstract class ChunkMapDistance { private final ChunkMapDistance.a e = new ChunkMapDistance.a(); private final ChunkMapDistance.b f = new ChunkMapDistance.b(8); private final ChunkMapDistance.c g = new ChunkMapDistance.c(33); - private final Set h = Sets.newHashSet(); -+ private Set h = Sets.newHashSet(); // Paper - -final ++ private java.util.Queue h = new java.util.LinkedList<>(); // Paper - -final private final PlayerChunk.c i; private final Mailbox> j; private final Mailbox k; -@@ -98,8 +98,12 @@ public abstract class ChunkMapDistance { +@@ -98,11 +99,12 @@ public abstract class ChunkMapDistance { ; } -- if (!this.h.isEmpty()) { -- this.h.forEach((playerchunk) -> { + // Paper start -+ Set currentPending = this.h; -+ this.h = Sets.newHashSet(); -+ if (!currentPending.isEmpty()) { -+ currentPending.forEach((playerchunk) -> { -+ // Paper end - playerchunk.a(playerchunkmap); - }); - this.h.clear(); + if (!this.h.isEmpty()) { +- this.h.forEach((playerchunk) -> { +- playerchunk.a(playerchunkmap); +- }); +- this.h.clear(); ++ while(!this.h.isEmpty()) { ++ this.h.remove().a(playerchunkmap); ++ } ++ // Paper end + return true; + } else { + if (!this.l.isEmpty()) { -- 2.22.0 diff --git a/Spigot-Server-Patches/0398-Chunk-debug-command.patch b/Spigot-Server-Patches/0398-Chunk-debug-command.patch index ab48f4dea..123b6d3d0 100644 --- a/Spigot-Server-Patches/0398-Chunk-debug-command.patch +++ b/Spigot-Server-Patches/0398-Chunk-debug-command.patch @@ -1,4 +1,4 @@ -From fff0d1d37878fe9cf31980df2db36cc80037d815 Mon Sep 17 00:00:00 2001 +From cf96fbf8f2765c7b40b3bf5d75e747af5d91d0f4 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 1 Jun 2019 13:00:55 -0700 Subject: [PATCH] Chunk debug command @@ -185,10 +185,10 @@ index 391726d99c..8db92edc36 100644 * Ported from MinecraftForge - author: LexManos - License: LGPLv2.1 */ diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index cd18150488..0c562a5f34 100644 +index f72843119a..c1fdd7b7a4 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -32,7 +32,7 @@ public abstract class ChunkMapDistance { +@@ -33,7 +33,7 @@ public abstract class ChunkMapDistance { private static final Logger LOGGER = LogManager.getLogger(); private static final int b = 33 + ChunkStatus.a(ChunkStatus.FULL) - 2; private final Long2ObjectMap> c = new Long2ObjectOpenHashMap(); diff --git a/Spigot-Server-Patches/0403-Fix-MC-154214.patch b/Spigot-Server-Patches/0403-Fix-MC-154214.patch index f68cf99fc..1a20ab3f8 100644 --- a/Spigot-Server-Patches/0403-Fix-MC-154214.patch +++ b/Spigot-Server-Patches/0403-Fix-MC-154214.patch @@ -1,4 +1,4 @@ -From 2132645f7895a363f1c726ccbe3a15639ab1d998 Mon Sep 17 00:00:00 2001 +From d1f7563e1c33a5892e42263f6f79bbef7ff52840 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 16 Jun 2019 23:30:25 -0700 Subject: [PATCH] Fix MC-154214 @@ -6,10 +6,10 @@ Subject: [PATCH] Fix MC-154214 Avoid adding player tickets when they're out of range of the closest player diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 0c562a5f34..7a76db08fc 100644 +index c1fdd7b7a4..1a6fe87cd8 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java -@@ -333,12 +333,18 @@ public abstract class ChunkMapDistance { +@@ -331,12 +331,18 @@ public abstract class ChunkMapDistance { } private void a(long i, int j, boolean flag, boolean flag1) { @@ -28,7 +28,7 @@ index 0c562a5f34..7a76db08fc 100644 ChunkMapDistance.this.a(i, ticket); ChunkMapDistance.this.l.add(i); }); -@@ -382,6 +388,7 @@ public abstract class ChunkMapDistance { +@@ -380,6 +386,7 @@ public abstract class ChunkMapDistance { } @@ -36,7 +36,7 @@ index 0c562a5f34..7a76db08fc 100644 private boolean c(int i) { return i <= this.e - 2; } -@@ -389,7 +396,7 @@ public abstract class ChunkMapDistance { +@@ -387,7 +394,7 @@ public abstract class ChunkMapDistance { class b extends ChunkMap {