Skip to content

Commit

Permalink
move out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Aug 24, 2024
1 parent 18eed89 commit 1fd62d7
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1354,20 +1354,20 @@ void addStatusConsumer(final ChunkStatus status, final Consumer<ChunkAccess> con
}

private void completeStatusConsumers(ChunkStatus status, final ChunkAccess chunk) {
// Update progress listener for LevelLoadingScreen
if (chunk != null) {
final ChunkProgressListener progressListener = this.world.getChunkSource().chunkMap.progressListener;
if (progressListener != null) {
final ChunkStatus finalStatus = status;
this.scheduler.scheduleChunkTask(this.chunkX, this.chunkZ, () -> {
progressListener.onStatusChange(this.vanillaChunkHolder.getPos(), finalStatus);
});
}
}

// need to tell future statuses to complete if cancelled
do {
this.completeStatusConsumers0(status, chunk);

// Update progress listener for LevelLoadingScreen
if (chunk != null) {
final ChunkProgressListener progressListener = this.world.getChunkSource().chunkMap.progressListener;
if (progressListener != null) {
final ChunkStatus finalStatus = status;
this.scheduler.scheduleChunkTask(this.chunkX, this.chunkZ, () -> {
progressListener.onStatusChange(this.vanillaChunkHolder.getPos(), finalStatus);
});
}
}
} while (chunk == null && status != (status = ((ChunkSystemChunkStatus)status).moonrise$getNextStatus()));
}

Expand Down

0 comments on commit 1fd62d7

Please sign in to comment.