Update to 1.14.4 (#2333)
This commit is contained in:
@@ -5,16 +5,16 @@ 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 a116ee128..8572eeba1 100644
|
||||
index 101eb58ace..63a688725e 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(); // 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 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;
|
||||
@@ -0,0 +0,0 @@ public abstract class ChunkMapDistance {
|
||||
@@ -22,11 +22,11 @@ index a116ee128..8572eeba1 100644
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
if (!this.h.isEmpty()) {
|
||||
if (!this.pendingChunkUpdates.isEmpty()) {
|
||||
- // 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();
|
||||
- java.util.Iterator<PlayerChunk> iter = this.pendingChunkUpdates.iterator();
|
||||
- int expectedSize = this.pendingChunkUpdates.size();
|
||||
- do {
|
||||
- PlayerChunk playerchunk = iter.next();
|
||||
- iter.remove();
|
||||
@@ -35,15 +35,15 @@ index a116ee128..8572eeba1 100644
|
||||
- playerchunk.a(playerchunkmap);
|
||||
-
|
||||
- // Reset iterator if set was modified using add()
|
||||
- if (this.h.size() != expectedSize) {
|
||||
- expectedSize = this.h.size();
|
||||
- iter = this.h.iterator();
|
||||
- if (this.pendingChunkUpdates.size() != expectedSize) {
|
||||
- expectedSize = this.pendingChunkUpdates.size();
|
||||
- iter = this.pendingChunkUpdates.iterator();
|
||||
- }
|
||||
- } while (iter.hasNext());
|
||||
- // CraftBukkit end
|
||||
-
|
||||
+ while(!this.h.isEmpty()) {
|
||||
+ this.h.remove().a(playerchunkmap);
|
||||
+ while(!this.pendingChunkUpdates.isEmpty()) {
|
||||
+ this.pendingChunkUpdates.remove().a(playerchunkmap);
|
||||
+ }
|
||||
+ // Paper end
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user