Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Spigot-Server-Patches/0395-ChunkMapDistance-CME.patch

48 Zeilen
1.8 KiB
Diff

From 4edf0cf5fcd69d7b5fc89c185144706f2de35667 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
index ed4e8d69ca..f72843119a 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
@@ -23,6 +23,7 @@ import it.unimi.dsi.fastutil.objects.ObjectSortedSet;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
+
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -36,7 +37,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> h = Sets.newHashSet();
+ private java.util.Queue<PlayerChunk> h = new java.util.LinkedList<>(); // Paper - -final
private final PlayerChunk.c i;
private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> j;
private final Mailbox<ChunkTaskQueueSorter.b> k;
@@ -98,11 +99,12 @@ public abstract class ChunkMapDistance {
2019-05-29 05:25:08 +02:00
;
}
+ // Paper start
if (!this.h.isEmpty()) {
- this.h.forEach((playerchunk) -> {
- playerchunk.a(playerchunkmap);
- });
- this.h.clear();
+ 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
--
2.22.0
2019-05-29 05:25:08 +02:00