13
0
geforkt von Mirrors/Paper

Remove making unused copy of visible chunks in ChunkMap#processUnloads

Dieser Commit ist enthalten in:
Jason Penilla 2021-12-27 03:53:25 -08:00
Ursprung e9947f8145
Commit 692283dbe2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0E75A301420E48F8
8 geänderte Dateien mit 41 neuen und 44 gelöschten Zeilen

Datei anzeigen

@ -165,7 +165,7 @@ index 626bcbc6dd013260c3f8b38a1d14e7ba35dc1e01..9e96b0465717bfa761289c255fd8d2f1
for (int i = 0; i < this.futures.length(); ++i) { for (int i = 0; i < this.futures.length(); ++i) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i); CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = (CompletableFuture) this.futures.get(i);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 847c4705f88b999976c9a99519939eb2e71e7f1d..1ff5ca11e3550dc730dd9d44acd666119f42898f 100644 index 847c4705f88b999976c9a99519939eb2e71e7f1d..42814c37f558b3fc0e59ba80c2ddaba3e6596d57 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -101,6 +101,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana @@ -101,6 +101,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
@ -241,16 +241,22 @@ index 847c4705f88b999976c9a99519939eb2e71e7f1d..1ff5ca11e3550dc730dd9d44acd66611
protected void saveAllChunks(boolean flush) { protected void saveAllChunks(boolean flush) {
if (flush) { if (flush) {
List<ChunkHolder> list = (List) this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); List<ChunkHolder> list = (List) this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList());
@@ -734,7 +793,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -732,13 +791,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
int l = 0; }
ObjectIterator objectiterator = this.visibleChunkMap.values().iterator();
int l = 0;
- ObjectIterator objectiterator = this.visibleChunkMap.values().iterator();
-
- while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { - while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) {
+ while (false && l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { // Paper - incremental chunk and player saving - if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { - ++l;
++l; - }
} - }
@@ -776,6 +835,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + // Paper - incremental chunk and player saving
}
@@ -776,6 +829,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.level.unload(chunk); this.level.unload(chunk);
} }
@ -258,7 +264,7 @@ index 847c4705f88b999976c9a99519939eb2e71e7f1d..1ff5ca11e3550dc730dd9d44acd66611
this.lightEngine.updateChunkStatus(ichunkaccess.getPos()); this.lightEngine.updateChunkStatus(ichunkaccess.getPos());
this.lightEngine.tryScheduleUpdate(); this.lightEngine.tryScheduleUpdate();
@@ -1173,6 +1233,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1173,6 +1227,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
asyncSaveData, chunk); asyncSaveData, chunk);
chunk.setUnsaved(false); chunk.setUnsaved(false);
@ -266,7 +272,7 @@ index 847c4705f88b999976c9a99519939eb2e71e7f1d..1ff5ca11e3550dc730dd9d44acd66611
} }
// Paper end // Paper end
@@ -1182,6 +1243,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1182,6 +1237,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!chunk.isUnsaved()) { if (!chunk.isUnsaved()) {
return false; return false;
} else { } else {

Datei anzeigen

@ -360,7 +360,7 @@ index 9e96b0465717bfa761289c255fd8d2f1df1be3d8..87271552aa85626f22f7f8569c8fb48f
return this.isEntityTickingReady; return this.isEntityTickingReady;
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c0442f262f13 100644 index 42814c37f558b3fc0e59ba80c2ddaba3e6596d57..d9f1456f5f217655396c4095e1595f55024efa76 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -128,6 +128,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -128,6 +128,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -448,7 +448,7 @@ index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c044
list1.add(playerchunk); list1.add(playerchunk);
list.add(completablefuture); list.add(completablefuture);
@@ -875,11 +925,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -869,11 +919,19 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (requiredStatus == ChunkStatus.EMPTY) { if (requiredStatus == ChunkStatus.EMPTY) {
return this.scheduleChunkLoad(chunkcoordintpair); return this.scheduleChunkLoad(chunkcoordintpair);
} else { } else {
@ -469,7 +469,7 @@ index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c044
if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) { if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) {
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureManager, this.lightEngine, (ichunkaccess) -> { CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureManager, this.lightEngine, (ichunkaccess) -> {
@@ -891,6 +949,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -885,6 +943,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else { } else {
return this.scheduleChunkGeneration(holder, requiredStatus); return this.scheduleChunkGeneration(holder, requiredStatus);
} }
@ -477,7 +477,7 @@ index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c044
} }
} }
@@ -947,14 +1006,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -941,14 +1000,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}; };
CompletableFuture<CompoundTag> chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z); CompletableFuture<CompoundTag> chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z);
@ -507,7 +507,7 @@ index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c044
return ret; return ret;
// Paper end // Paper end
} }
@@ -1006,7 +1075,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1000,7 +1069,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.releaseLightTicket(chunkcoordintpair); this.releaseLightTicket(chunkcoordintpair);
return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
}); });
@ -519,7 +519,7 @@ index 1ff5ca11e3550dc730dd9d44acd666119f42898f..0b8b813d329aa1de912057ddeb52c044
} }
protected void releaseLightTicket(ChunkPos pos) { protected void releaseLightTicket(ChunkPos pos) {
@@ -1090,7 +1162,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1084,7 +1156,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
long i = chunkHolder.getPos().toLong(); long i = chunkHolder.getPos().toLong();
Objects.requireNonNull(chunkHolder); Objects.requireNonNull(chunkHolder);

Datei anzeigen

@ -54,7 +54,7 @@ index 87271552aa85626f22f7f8569c8fb48fe4b30bf3..80aae4303e011dad13ce818136f0383e
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0b8b813d329aa1de912057ddeb52c0442f262f13..a97bf06a0e8ba1cd612f7e8be2585bfdfbdfa969 100644 index d9f1456f5f217655396c4095e1595f55024efa76..71cfc51223e12cdd1030f0e5bb2263d594fa4c3c 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -636,7 +636,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -636,7 +636,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -66,7 +66,7 @@ index 0b8b813d329aa1de912057ddeb52c0442f262f13..a97bf06a0e8ba1cd612f7e8be2585bfd
} }
@Nullable @Nullable
@@ -1046,6 +1046,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1040,6 +1040,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return "chunkGenerate " + requiredStatus.getName(); return "chunkGenerate " + requiredStatus.getName();
}); });
Executor executor = (runnable) -> { Executor executor = (runnable) -> {

Datei anzeigen

@ -10,10 +10,10 @@ chunk future to complete. We can simply schedule to the immediate
executor to get this effect, rather than the main mailbox. executor to get this effect, rather than the main mailbox.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 2af478902b528f335797c691730afb2657d4e6c4..71ca2c2edc6a89e9365b4686c233f60cea12a472 100644 index 76f40342098c1cc1ffb855ef41349953f8b94d0f..0090ef1df54c5b438bc4b23d2ed8978575e48dae 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1259,9 +1259,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1253,9 +1253,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return chunk; return chunk;
}); });

Datei anzeigen

@ -8,7 +8,7 @@ Sync loading the chunk at this stage would cause it to load
older data, as well as screwing our region state. older data, as well as screwing our region state.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 71ca2c2edc6a89e9365b4686c233f60cea12a472..09bb6e14864af68e9833e171a33aa981f51c8569 100644 index 0090ef1df54c5b438bc4b23d2ed8978575e48dae..e0b445c13bae4205bb33b082dfb0b6b6a4351e6d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -296,6 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -296,6 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -27,7 +27,7 @@ index 71ca2c2edc6a89e9365b4686c233f60cea12a472..09bb6e14864af68e9833e171a33aa981
if (k > ChunkMap.MAX_CHUNK_DISTANCE && level > ChunkMap.MAX_CHUNK_DISTANCE) { if (k > ChunkMap.MAX_CHUNK_DISTANCE && level > ChunkMap.MAX_CHUNK_DISTANCE) {
return holder; return holder;
} else { } else {
@@ -870,6 +872,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -864,6 +866,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (completablefuture1 != completablefuture) { if (completablefuture1 != completablefuture) {
this.scheduleUnload(pos, holder); this.scheduleUnload(pos, holder);
} else { } else {
@ -40,7 +40,7 @@ index 71ca2c2edc6a89e9365b4686c233f60cea12a472..09bb6e14864af68e9833e171a33aa981
// Paper start // Paper start
boolean removed; boolean removed;
if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) { if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) {
@@ -906,6 +914,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -900,6 +908,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z); this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
} }
} // Paper end } // Paper end

Datei anzeigen

@ -35,7 +35,7 @@ index b3516862d796c2d9fcc1c67a6073445403d73088..b61abf227a04b4565c2525e5f469db30
List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values()); List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values());
List<ServerPlayer> players = world.players; List<ServerPlayer> players = world.players;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2beef236d2 100644 index e0b445c13bae4205bb33b082dfb0b6b6a4351e6d..9c729af97a7658778bd96c121823bc9023f35c12 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -120,9 +120,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -120,9 +120,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -117,16 +117,7 @@ index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2b
if (playerchunk != null) { if (playerchunk != null) {
this.pendingUnloads.put(j, playerchunk); this.pendingUnloads.put(j, playerchunk);
@@ -854,7 +861,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -927,7 +934,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
int l = 0;
- ObjectIterator objectiterator = this.visibleChunkMap.values().iterator();
+ Iterator objectiterator = this.updatingChunks.getVisibleValuesCopy().iterator(); // Paper
while (false && l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { // Paper - incremental chunk and player saving
if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) {
@@ -933,7 +940,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (!this.modified) { if (!this.modified) {
return false; return false;
} else { } else {
@ -140,7 +131,7 @@ index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2b
this.modified = false; this.modified = false;
return true; return true;
} }
@@ -1411,7 +1423,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1405,7 +1417,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.viewDistance = j; this.viewDistance = j;
this.distanceManager.updatePlayerTickets(this.viewDistance + 1); this.distanceManager.updatePlayerTickets(this.viewDistance + 1);
@ -149,7 +140,7 @@ index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2b
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) objectiterator.next(); ChunkHolder playerchunk = (ChunkHolder) objectiterator.next();
@@ -1454,7 +1466,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1448,7 +1460,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
public int size() { public int size() {
@ -158,7 +149,7 @@ index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2b
} }
public DistanceManager getDistanceManager() { public DistanceManager getDistanceManager() {
@@ -1462,13 +1474,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1456,13 +1468,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
protected Iterable<ChunkHolder> getChunks() { protected Iterable<ChunkHolder> getChunks() {

Datei anzeigen

@ -7,7 +7,7 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap. better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 53399b80e60872224ba6b77f41626b2beef236d2..087eec200cec325edb11f7fbae1a81a216b019d6 100644 index 9c729af97a7658778bd96c121823bc9023f35c12..ad0997ec4e36937e937195d95df701b1954ef885 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -108,6 +108,7 @@ import org.apache.logging.log4j.LogManager; @@ -108,6 +108,7 @@ import org.apache.logging.log4j.LogManager;
@ -18,7 +18,7 @@ index 53399b80e60872224ba6b77f41626b2beef236d2..087eec200cec325edb11f7fbae1a81a2
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider { public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
@@ -2101,7 +2102,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -2095,7 +2096,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity; final Entity entity;
private final int range; private final int range;
SectionPos lastSectionPos; SectionPos lastSectionPos;

Datei anzeigen

@ -10,7 +10,7 @@ This patch also prevents the saving/unloading of POI data when
world saving is disabled. world saving is disabled.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 0c046cd0fab44aecd41ef5c1477b13ea9606aee4..0e474819c506e6d5e1731d49610c7cf472aa49c4 100644 index 3be958576599995e083d4bea85e89099911795a6..cd85d1d97b8fbc8979100f2097e77070a840f3b1 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -792,6 +792,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -792,6 +792,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -30,7 +30,7 @@ index 0c046cd0fab44aecd41ef5c1477b13ea9606aee4..0e474819c506e6d5e1731d49610c7cf4
private void processUnloads(BooleanSupplier shouldKeepTicking) { private void processUnloads(BooleanSupplier shouldKeepTicking) {
LongIterator longiterator = this.toDrop.iterator(); LongIterator longiterator = this.toDrop.iterator();
@@ -1006,6 +1007,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1000,6 +1001,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z); this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
} }
// Paper end // Paper end
@ -38,7 +38,7 @@ index 0c046cd0fab44aecd41ef5c1477b13ea9606aee4..0e474819c506e6d5e1731d49610c7cf4
if (ichunkaccess instanceof LevelChunk) { if (ichunkaccess instanceof LevelChunk) {
((LevelChunk) ichunkaccess).setLoaded(false); ((LevelChunk) ichunkaccess).setLoaded(false);
} }
@@ -1034,6 +1036,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1028,6 +1030,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
for (int index = 0, len = this.regionManagers.size(); index < len; ++index) { for (int index = 0, len = this.regionManagers.size(); index < len; ++index) {
this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z); this.regionManagers.get(index).removeChunk(holder.pos.x, holder.pos.z);
} }
@ -46,7 +46,7 @@ index 0c046cd0fab44aecd41ef5c1477b13ea9606aee4..0e474819c506e6d5e1731d49610c7cf4
} // Paper end } // Paper end
} finally { this.unloadingPlayerChunk = unloadingBefore; } // Paper - do not allow ticket level changes while unloading chunks } finally { this.unloadingPlayerChunk = unloadingBefore; } // Paper - do not allow ticket level changes while unloading chunks
@@ -1110,6 +1113,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1104,6 +1107,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
this.poiManager.loadInData(pos, chunkHolder.poiData); this.poiManager.loadInData(pos, chunkHolder.poiData);
chunkHolder.tasks.forEach(Runnable::run); chunkHolder.tasks.forEach(Runnable::run);