From bce1f95c81034c2b505633457e295b814c9c0c29 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:07:09 -0700 Subject: [PATCH] Fix level loading screen showing 0% until in-game --- .../patches/chunk_system/scheduling/NewChunkHolder.java | 3 +++ src/main/resources/moonrise.accesswidener | 1 + 2 files changed, 4 insertions(+) diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java index b6a471b6..0fa12643 100644 --- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java +++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java @@ -1363,6 +1363,9 @@ private void completeStatusConsumers0(final ChunkStatus status, final ChunkAcces final List> consumers; consumers = this.statusWaiters.remove(status); + // Update progress listener for LevelLoadingScreen + this.world.getChunkSource().chunkMap.progressListener.onStatusChange(chunk.getPos(), status); + if (consumers == null) { return; } diff --git a/src/main/resources/moonrise.accesswidener b/src/main/resources/moonrise.accesswidener index 76c9eaed..e5f0e764 100644 --- a/src/main/resources/moonrise.accesswidener +++ b/src/main/resources/moonrise.accesswidener @@ -43,6 +43,7 @@ accessible method net/minecraft/server/level/ChunkMap setServerViewDistance (I)V accessible method net/minecraft/server/level/ChunkMap upgradeChunkTag (Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/nbt/CompoundTag; accessible field net/minecraft/server/level/ChunkMap worldGenContext Lnet/minecraft/world/level/chunk/status/WorldGenContext; accessible field net/minecraft/server/level/ChunkMap tickingGenerated Ljava/util/concurrent/atomic/AtomicInteger; +accessible field net/minecraft/server/level/ChunkMap progressListener Lnet/minecraft/server/level/progress/ChunkProgressListener; # ChunkLevel accessible field net/minecraft/server/level/ChunkLevel FULL_CHUNK_LEVEL I