Paper/Spigot-Server-Patches/0377-ChunkMapDistance-CME.patch
Aikar e4d10a6d67
Updated Upstream (Bukkit/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

Bukkit Changes:
122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches
a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType()

CraftBukkit Changes:
bbe3d58e SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException
3075579f Add FaceAttachable interface to handle Grindstone facing in common with Switches
95bd4238 SPIGOT-5647: ZombieVillager entity should have getVillagerType()
4d975ac3 SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
2020-04-02 17:09:17 -04:00

55 lines
2.4 KiB
Diff

From ec5bb794058e28e30c5a7afe1a70cbad3da5f928 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 ae66129777..0244768f76 100644
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
@@ -33,7 +33,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<PlayerChunk> pendingChunkUpdates = Sets.newHashSet();
+ private final java.util.Queue<PlayerChunk> pendingChunkUpdates = new java.util.LinkedList<>(); // PAIL pendingChunkUpdates // Paper - use a queue
private final ChunkTaskQueueSorter i;
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> j;
private final Mailbox<ChunkTaskQueueSorter.b> k;
@@ -94,26 +94,12 @@ public abstract class ChunkMapDistance {
;
}
+ // Paper start
if (!this.pendingChunkUpdates.isEmpty()) {
- // CraftBukkit start
- // Iterate pending chunk updates with protection against concurrent modification exceptions
- java.util.Iterator<PlayerChunk> iter = this.pendingChunkUpdates.iterator();
- int expectedSize = this.pendingChunkUpdates.size();
- do {
- PlayerChunk playerchunk = iter.next();
- iter.remove();
- expectedSize--;
-
- playerchunk.a(playerchunkmap);
-
- // Reset iterator if set was modified using add()
- if (this.pendingChunkUpdates.size() != expectedSize) {
- expectedSize = this.pendingChunkUpdates.size();
- iter = this.pendingChunkUpdates.iterator();
- }
- } while (iter.hasNext());
- // CraftBukkit end
-
+ while(!this.pendingChunkUpdates.isEmpty()) {
+ this.pendingChunkUpdates.remove().a(playerchunkmap);
+ }
+ // Paper end
return true;
} else {
if (!this.l.isEmpty()) {
--
2.25.1