mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Always use updatingChunks for saveAllChunks (#6534)
This commit is contained in:
parent
887ccc412a
commit
fbedd625a2
@ -1,7 +1,7 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||||
Date: Tue, 31 Aug 2021 17:12:01 -0700
|
Date: Tue, 31 Aug 2021 17:12:01 -0700
|
||||||
Subject: [PATCH] Use updatingChunks for flush saving
|
Subject: [PATCH] Use updatingChunks for saving
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
@ -21,9 +21,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
protected void saveAllChunks(boolean flush) {
|
protected void saveAllChunks(boolean flush) {
|
||||||
|
+ final Long2ObjectLinkedOpenHashMap<ChunkHolder> visibleChunks = this.getVisibleChunks(); // Paper
|
||||||
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());
|
||||||
+ List<ChunkHolder> list = (List) this.getVisibleChunks().values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); // Paper
|
+ List<ChunkHolder> list = visibleChunks.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).peek(ChunkHolder::refreshAccessibility).collect(Collectors.toList()); // Paper
|
||||||
MutableBoolean mutableboolean = new MutableBoolean();
|
MutableBoolean mutableboolean = new MutableBoolean();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
|
this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour
|
||||||
|
// this.i(); // Paper - nuke IOWorker
|
||||||
|
} else {
|
||||||
|
- this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).forEach((playerchunk) -> {
|
||||||
|
+ visibleChunks.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).forEach((playerchunk) -> { // Paper
|
||||||
|
ChunkAccess ichunkaccess = (ChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error
|
||||||
|
|
||||||
|
if (ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk) {
|
Loading…
Reference in New Issue
Block a user