Skip to content

Commit 4f74581

Browse files
committed
fix: ghost mushroom attempt 2: ensure post-processed chunk is open
Related to #336
1 parent 5054bef commit 4f74581

File tree

1 file changed

+7
-5
lines changed
  • c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/statuses

1 file changed

+7
-5
lines changed

c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/statuses/ServerAccessible.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ private static boolean needSendChunks() {
8787

8888
private static void sendChunkToPlayer(ServerChunkLoadingManager tacs, ItemHolder<ChunkPos, ChunkState, ChunkLoadingContext, NewChunkHolderVanillaInterface> holder) {
8989
holder.submitOp(CompletableFuture.runAsync(() -> {
90-
final Chunk chunk = holder.getItem().get().chunk();
91-
if (chunk instanceof WorldChunk worldChunk) {
92-
((IPartialPostProcessing) worldChunk).c2me$runBorderPostProcessing();
93-
((IThreadedAnvilChunkStorage) tacs).invokeSendToPlayers(worldChunk);
90+
if (holder.isOpen()) {
91+
final Chunk chunk = holder.getItem().get().chunk();
92+
if (chunk instanceof WorldChunk worldChunk) {
93+
((IPartialPostProcessing) worldChunk).c2me$runBorderPostProcessing();
94+
((IThreadedAnvilChunkStorage) tacs).invokeSendToPlayers(worldChunk);
95+
}
9496
}
95-
}, ((IThreadedAnvilChunkStorage) tacs).getMainThreadExecutor()::submit));
97+
}, ((IThreadedAnvilChunkStorage) tacs).getMainThreadExecutor()::send));
9698
}
9799

98100
private static WorldChunk toFullChunk(ProtoChunk protoChunk, ServerWorld serverWorld) {

0 commit comments

Comments
 (0)