fix issue resulting from kenny's apatch addiction

This commit is contained in:
Jason Penilla 2022-02-28 21:11:35 -07:00
parent 146ac7bcd6
commit b9037a5c7d
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8
3 changed files with 15 additions and 15 deletions

View File

@ -25,7 +25,7 @@ This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 7e3f7b69fc7a608dd82b471d832cc401a77f0738..86a06c7ee3b92fbff1e21ad36b6034d892cd0c01 100644
index 7e3f7b69fc7a608dd82b471d832cc401a77f0738..aeae3fb3d05b513031e4af217fe3db7fa3ec4a75 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -178,6 +178,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -36,15 +36,15 @@ index 7e3f7b69fc7a608dd82b471d832cc401a77f0738..86a06c7ee3b92fbff1e21ad36b6034d8
// Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
@@ -1030,7 +1031,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
});
@@ -1012,7 +1013,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return (LevelChunk) list.get(list.size() / 2);
});
}, (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.
});
return completablefuture1;
}
}).thenApplyAsync((either) -> {
return either.ifLeft((chunk) -> {
chunk.postProcessGeneration();
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index cf56b2ed508352205ef6ec71519b0626aa698987..1b6fb81079d3ad5d3c33be67a1c05111f9dd5f2d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java

View File

@ -10,17 +10,17 @@ chunk future to complete. We can simply schedule to the immediate
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
index 5261c7a44200e2cc191b67900c7771ca31fb33df..16350310a235c321e48c29fbace2969b43778bf5 100644
index 7595f2bd6b26946e9f437dbd962a3b23e95a52b6..5602576dd8aea04fc233a801cce9bc14d27a55ec 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1302,9 +1302,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.playerLoadedChunk(entityplayer, mutableobject, chunk);
});
@@ -1315,9 +1315,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return chunk;
});
- }, (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.
- this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
- });
+ }, this.mainThreadExecutor); // Paper - queue to execute immediately so this doesn't delay chunk unloading
return completablefuture1;
}
public int getTickingGenerated() {

View File

@ -1381,7 +1381,7 @@ index 36b6e7295cf7484675c8c2b9624c1f6fea7aed1d..38db3905f47fefb5c958fa24aef2313e
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index b2efa5f24d20cb16218a0e7522866ee2faaef244..e6c6432f35add7f4c27375e4420179a8ec9355a0 100644
index 9f367f3e33c6bad8b9df4f18559ebcd98a97c95c..d93eb2d0f38598a8939048de16dc7f14f2d39302 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -217,6 +217,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -1445,8 +1445,8 @@ index b2efa5f24d20cb16218a0e7522866ee2faaef244..e6c6432f35add7f4c27375e4420179a8
- });
+ // Paper - no-tick view distance - moved to Chunk neighbour update
});
}, this.mainThreadExecutor); // Paper - queue to execute immediately so this doesn't delay chunk unloading
return completablefuture1;
}, (runnable) -> {
this.mainThreadMailbox.tell(ChunkTaskPriorityQueueSorter.message(holder, runnable));
@@ -1609,33 +1609,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
int k = this.viewDistance;