Fix chunk unload and cleanup logic #1347#1406
Merged
codeHusky merged 2 commits intosmartcmd:mainfrom Mar 25, 2026
Merged
Conversation
chrisGrando
pushed a commit
to chrisGrando/LegacyMinecraft
that referenced
this pull request
Mar 26, 2026
* Fix chunk unload and cleanup logic, fixes smartcmd#1347 * Applying formatting to code I edited 😝 (cherry picked from commit a24318e)
codeHusky
added a commit
that referenced
this pull request
Mar 26, 2026
This reverts commit a24318e. This fix introduces broken behavior for dedicated servers. It will be merged back in once the related issue is fixed
ArchieDxncan
pushed a commit
to ArchieDxncan/LegacyDxncan
that referenced
this pull request
Apr 1, 2026
* Fix chunk unload and cleanup logic, fixes smartcmd#1347 * Applying formatting to code I edited 😝
ArchieDxncan
pushed a commit
to ArchieDxncan/LegacyDxncan
that referenced
this pull request
Apr 1, 2026
This reverts commit a24318e. This fix introduces broken behavior for dedicated servers. It will be merged back in once the related issue is fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed chunk bug where loaded chunks would never unload and could cause game crashes after some time. Also fixed an issue where changing your render distance caused the game to crash.
Changes
Previous Behavior
Chunks outside the new radius were never fully unloaded, remaining in cache and reloading instantly when the radius increased.
Root Cause
Chunk cache entries and related state were not being cleared during unload or radius changes.
New Behavior
Chunks outside the radius are now fully removed from the cache, tracking lists, and pending requests. The active chunk set is rebuilt correctly when the radius changes.
Fix Implementation
chach[idx],hasData[idx]addRequestson radius changeAI Use Disclosure
No.
Related Issues
2026-03-25.00-09-42.mp4