PaperMC/Spigot-Server-Patches/0397-ChunkMapDistance-CME.patch
Spottedleaf 2f782a6652 Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
17543ecf SPIGOT-5035: Error Using Virtual Merchant GUI
0fc6922b SPIGOT-5028: Villager#setVillagerExperience() doesn't work
bdbdbe44 SPIGOT-5024: Fox error - Unknown target reason
2019-06-06 16:56:51 +01:00

37 lines
1.5 KiB
Diff

From c74969845263459f4f12c12766fcfaffa6d7522b Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
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 ba4b9fa59c..d3c2ad3c40 100644
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
@@ -39,7 +39,7 @@ public abstract class ChunkMapDistance {
private int entitydistance;
private final ChunkMapDistance.b i = new ChunkMapDistance.b(8);
private final ChunkMapDistance.d j = new ChunkMapDistance.d(33);
- private final Set<PlayerChunk> k = Sets.newHashSet();
+ private Set<PlayerChunk> k = Sets.newHashSet(); // Paper - -final
private final PlayerChunk.c l;
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> m;
private final Mailbox<ChunkTaskQueueSorter.b> n;
@@ -117,8 +117,12 @@ public abstract class ChunkMapDistance {
;
}
- if (!this.k.isEmpty()) {
- this.k.forEach((playerchunk) -> {
+ // Paper start
+ Set<PlayerChunk> currentPending = this.k;
+ this.k = Sets.newHashSet();
+ if (!currentPending.isEmpty()) {
+ currentPending.forEach((playerchunk) -> {
+ // Paper end
playerchunk.a(playerchunkmap);
});
this.k.clear();
--
2.21.0