Concurrent Chunk Management Engine (Fabric)

Concurrent Chunk Management Engine (Fabric)

231k Downloads

c2me incompatible with Immersive Portals Mod

QPCrummer opened this issue ยท 4 comments

commented

When creating/loading a world, it won't finish loading and either gets stuck at 0%(on a server) or 100%(on a client).

commented

oops

commented

It seems that this issue comes from Immersive Portals itself:
https://github.com/qouteall/ImmersivePortalsMod/blob/3584879f696d8195d99576ba8e9588a634c7673d/imm_ptl_core/src/main/java/qouteall/imm_ptl/core/mixin/common/chunk_sync/MixinThreadedAnvilChunkStorage_C.java#L133

This duplicates the below vanilla code:

   public CompletableFuture<Either<WorldChunk, ChunkHolder.Unloaded>> makeChunkTickable(ChunkHolder holder) {
        ...
        CompletableFuture<Either<WorldChunk, ChunkHolder.Unloaded>> completableFuture2 = ...;
        completableFuture2.thenAcceptAsync((either) -> {
            either.ifLeft((worldChunk) -> {
                this.totalChunksLoadedCount.getAndIncrement(); // <--- here
                ....
           });
         }, ...);
        return completableFuture2;

And in preparStartRegion of MinecraftServer:

while(serverChunkManager.getTotalChunksLoadedCount() != 441) { // <--- here
    this.timeReference = Util.getMeasuringTimeMs() + 10L;
    this.runTasksTillTickEnd();
}

Here vanilla uses a equality check to check whether spawn chunks are all loaded. It may be fine if the chunk system is slow, but this will go up to 882 if the chunk system is fast enough. This also causes servers with Immersive Portals to complete start region before it fully completes in my testing.

I'll open an issue there shortly.

commented

We are already tracking this issue internally.