Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make currently loading chunk available during entity loading #4

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ public void run() {
try {
platformHooks.setCurrentlyLoading(this.chunkHolder.vanillaChunkHolder, chunk);
chunk.runPostLoad();
// Unlike Vanilla, we load the entity chunk here, as we load the NBT in empty status (unlike Vanilla)
// This brings entity addition back in line with older versions of the game
// Since we load the NBT in the empty status, this will never block for I/O
((ChunkSystemServerLevel)this.world).moonrise$getChunkTaskScheduler().chunkHolderManager.getOrCreateEntityChunk(this.chunkX, this.chunkZ, false);
} finally {
platformHooks.setCurrentlyLoading(this.chunkHolder.vanillaChunkHolder, null);
}
// Unlike Vanilla, we load the entity chunk here, as we load the NBT in empty status (unlike Vanilla)
// This brings entity addition back in line with older versions of the game
// Since we load the NBT in the empty status, this will never block for I/O
((ChunkSystemServerLevel)this.world).moonrise$getChunkTaskScheduler().chunkHolderManager.getOrCreateEntityChunk(this.chunkX, this.chunkZ, false);

// we don't need the entitiesInLevel, not sure why it's there
chunk.setLoaded(true);
Expand Down