mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Revert chunk postprocessing back to 1.18.1 logic
This commit is contained in:
parent
d694a49769
commit
1f42cc66e7
@ -68,14 +68,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
|
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
return (LevelChunk) list.get(list.size() / 2);
|
return ChunkStatus.FULL;
|
||||||
});
|
});
|
||||||
}, (runnable) -> {
|
CompletableFuture<Either<LevelChunk, ChunkHolder.ChunkLoadingFailure>> completablefuture1 = completablefuture.thenApplyAsync((either) -> {
|
||||||
|
- return either.mapLeft((list) -> {
|
||||||
|
- return (LevelChunk) list.get(list.size() / 2);
|
||||||
|
- });
|
||||||
|
- }, (runnable) -> {
|
||||||
- this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
|
- this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
|
||||||
+ this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, () -> ChunkMap.this.chunkLoadConversionCallbackExecutor.execute(runnable))); // Paper - delay running Chunk post processing until outside of the sorter to prevent a deadlock scenario when post processing causes another chunk request.
|
- }).thenApplyAsync((either) -> {
|
||||||
}).thenApplyAsync((either) -> {
|
- return either.ifLeft((chunk) -> {
|
||||||
return either.ifLeft((chunk) -> {
|
+ // Paper start
|
||||||
|
+ return either.flatMap((list) -> {
|
||||||
|
+ LevelChunk chunk = (LevelChunk) list.get(list.size() / 2);
|
||||||
chunk.postProcessGeneration();
|
chunk.postProcessGeneration();
|
||||||
|
this.level.startTickingChunk(chunk);
|
||||||
|
+ return Either.left(chunk);
|
||||||
|
+
|
||||||
|
});
|
||||||
|
- }, this.mainThreadExecutor);
|
||||||
|
+ }, (runnable) -> {
|
||||||
|
+ this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, () -> ChunkMap.this.chunkLoadConversionCallbackExecutor.execute(runnable))); // Paper - delay running Chunk post processing until outside of the sorter to prevent a deadlock scenario when post processing causes another chunk request.
|
||||||
|
+ });
|
||||||
|
+ // Paper end
|
||||||
|
|
||||||
|
completablefuture1.thenAcceptAsync((either) -> {
|
||||||
|
either.ifLeft((chunk) -> {
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
|
Loading…
Reference in New Issue
Block a user