mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-29 19:33:51 -07:00
Updated Upstream (CraftBukkit/Spigot)
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:eb2e6578
SPIGOT-5116: Fix concurrent modification exception inside ChunkMapDistance989f9b3d
SPIGOT-4849: Fix server crash when accessing chunks during chunk load/unload/populate eventsf554183c
SPIGOT-5171: Don't fire PlayerTeleportEvent if not actually moving2349feb8
SPIGOT-5163: Cancelling PlayerBucketFillEvent visually removes the targeted block Spigot Changes: 9a643a6a Remove DataWatcher Locking
This commit is contained in:
@@ -5,15 +5,15 @@ 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..a116826490 100644
|
||||
index a116ee128..8572eeba1 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
||||
@@ -0,0 +0,0 @@ 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> h = Sets.newHashSet();
|
||||
+ private final java.util.Queue<PlayerChunk> h = new java.util.LinkedList<>(); // Paper - use a queue
|
||||
- private final Set<PlayerChunk> h = Sets.newHashSet(); // PAIL pendingChunkUpdates
|
||||
+ private final java.util.Queue<PlayerChunk> h = new java.util.LinkedList<>(); // PAIL pendingChunkUpdates // Paper - use a queue
|
||||
private final PlayerChunk.c i;
|
||||
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> j;
|
||||
private final Mailbox<ChunkTaskQueueSorter.b> k;
|
||||
@@ -23,10 +23,25 @@ index ed4e8d69ca..a116826490 100644
|
||||
|
||||
+ // Paper start
|
||||
if (!this.h.isEmpty()) {
|
||||
- this.h.forEach((playerchunk) -> {
|
||||
- // CraftBukkit start
|
||||
- // Iterate pending chunk updates with protection against concurrent modification exceptions
|
||||
- java.util.Iterator<PlayerChunk> iter = this.h.iterator();
|
||||
- int expectedSize = this.h.size();
|
||||
- do {
|
||||
- PlayerChunk playerchunk = iter.next();
|
||||
- iter.remove();
|
||||
- expectedSize--;
|
||||
-
|
||||
- playerchunk.a(playerchunkmap);
|
||||
- });
|
||||
- this.h.clear();
|
||||
-
|
||||
- // Reset iterator if set was modified using add()
|
||||
- if (this.h.size() != expectedSize) {
|
||||
- expectedSize = this.h.size();
|
||||
- iter = this.h.iterator();
|
||||
- }
|
||||
- } while (iter.hasNext());
|
||||
- // CraftBukkit end
|
||||
-
|
||||
+ while(!this.h.isEmpty()) {
|
||||
+ this.h.remove().a(playerchunkmap);
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user