2019-07-17 00:09:32 +02:00
|
|
|
From 5c4cd1ff04671b21a3b9b30091e5dcb9306decfa Mon Sep 17 00:00:00 2001
|
2019-05-29 05:25:08 +02:00
|
|
|
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
|
2019-07-17 00:09:32 +02:00
|
|
|
index a116ee128..8572eeba1 100644
|
2019-05-29 05:25:08 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java
|
2019-07-05 04:23:33 +02:00
|
|
|
@@ -36,7 +36,7 @@ public abstract class ChunkMapDistance {
|
2019-06-25 03:47:58 +02:00
|
|
|
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);
|
2019-07-17 00:09:32 +02:00
|
|
|
- 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
|
2019-06-25 03:47:58 +02:00
|
|
|
private final PlayerChunk.c i;
|
|
|
|
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> j;
|
|
|
|
private final Mailbox<ChunkTaskQueueSorter.b> k;
|
2019-07-17 00:09:32 +02:00
|
|
|
@@ -98,26 +98,12 @@ public abstract class ChunkMapDistance {
|
2019-05-29 05:25:08 +02:00
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
2019-07-02 20:50:03 +02:00
|
|
|
if (!this.h.isEmpty()) {
|
2019-07-17 00:09:32 +02:00
|
|
|
- // 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--;
|
|
|
|
-
|
2019-07-02 20:50:03 +02:00
|
|
|
- playerchunk.a(playerchunkmap);
|
2019-07-17 00:09:32 +02:00
|
|
|
-
|
|
|
|
- // 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
|
|
|
|
-
|
2019-07-02 20:50:03 +02:00
|
|
|
+ while(!this.h.isEmpty()) {
|
|
|
|
+ this.h.remove().a(playerchunkmap);
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
if (!this.l.isEmpty()) {
|
2019-05-29 05:25:08 +02:00
|
|
|
--
|
2019-06-25 03:47:58 +02:00
|
|
|
2.22.0
|
2019-05-29 05:25:08 +02:00
|
|
|
|