diff options
Diffstat (limited to 'patches/server/0756-Do-not-copy-visible-chunks.patch')
-rw-r--r-- | patches/server/0756-Do-not-copy-visible-chunks.patch | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/patches/server/0756-Do-not-copy-visible-chunks.patch b/patches/server/0756-Do-not-copy-visible-chunks.patch index e649466db3..ba44aac258 100644 --- a/patches/server/0756-Do-not-copy-visible-chunks.patch +++ b/patches/server/0756-Do-not-copy-visible-chunks.patch @@ -35,7 +35,7 @@ index 35949e9c15eb998aa89842d34d0999cd973590e0..15f0c85ba9f4f9666e94e67dde43eb2e List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values()); 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 -index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14ffc8ec338 100644 +index 09bb6e14864af68e9833e171a33aa981f51c8569..53399b80e60872224ba6b77f41626b2beef236d2 100644 --- a/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 @@ -61,7 +61,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f this.pendingUnloads = new Long2ObjectLinkedOpenHashMap(); this.entitiesInLevel = new LongOpenHashSet(); this.toDrop = new LongOpenHashSet(); -@@ -554,12 +556,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -516,12 +518,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @Nullable public ChunkHolder getUpdatingChunkIfPresent(long pos) { @@ -81,7 +81,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f } protected IntSupplier getChunkQueueLevel(long pos) { -@@ -721,7 +728,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -683,7 +690,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider // Paper end } @@ -90,7 +90,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f this.modified = true; } -@@ -801,7 +808,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -763,7 +770,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider protected void saveAllChunks(boolean flush) { if (flush) { @@ -99,7 +99,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f MutableBoolean mutableboolean = new MutableBoolean(); do { -@@ -832,7 +839,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -794,7 +801,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider //this.flushWorker(); // Paper - nuke IOWorker this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour } else { @@ -108,7 +108,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f } } -@@ -866,7 +873,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -828,7 +835,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider while (longiterator.hasNext()) { // Spigot long j = longiterator.nextLong(); longiterator.remove(); // Spigot @@ -117,7 +117,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f if (playerchunk != null) { this.pendingUnloads.put(j, playerchunk); -@@ -892,7 +899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -854,7 +861,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } int l = 0; @@ -126,7 +126,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f while (false && l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { // Paper - incremental chunk and player saving if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { -@@ -971,7 +978,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -933,7 +940,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider if (!this.modified) { return false; } else { @@ -140,16 +140,16 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f this.modified = false; return true; } -@@ -1449,7 +1461,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1411,7 +1423,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.viewDistance = j; - this.distanceManager.updatePlayerTickets(this.viewDistance); + this.distanceManager.updatePlayerTickets(this.viewDistance + 1); - ObjectIterator objectiterator = this.updatingChunkMap.values().iterator(); + Iterator objectiterator = this.updatingChunks.getVisibleValuesCopy().iterator(); // Paper while (objectiterator.hasNext()) { ChunkHolder playerchunk = (ChunkHolder) objectiterator.next(); -@@ -1491,7 +1503,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1454,7 +1466,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } public int size() { @@ -158,7 +158,7 @@ index 5157eac0190c6e1458dedfb1cb2eddee5639407e..800191e9ed63773333b5650d8ffcb14f } public DistanceManager getDistanceManager() { -@@ -1499,13 +1511,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1462,13 +1474,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } protected Iterable<ChunkHolder> getChunks() { |