1.15pre-1 batching chunks NPE
See original GitHub issueVersions:
- API 0.4.13+build.264-1.15
- Minecraft 1.15-pre1
- Loader 0.7.1+build.173
- Yarn 3:v2
My game is randomly crashing while flying around new dev worlds with the following error. The only noticeable additions to my game are:
- a simple custom lake feature
- a custom fluid, which worked on all previous versions
It seems like the erroring method is MixinChunkRebuildTask#hookChunkBuild
, but I can’t reproduce the error reliably enough to track down the cause.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can push it right out, glad to know that it is the correct fix, I wasnt too sure.
That’s the fix. Assignment to a local var is also what vanilla does to prevent this.
This is happening because the chunk rebuild is being cancelled after the initial retrieval and before the cast. Typically this would happen because of rapid updates to the same chunk. IIRC, when the an update is scheduled, it cancels any update already in flight. Cancelling sets the region field to null.
This bug doesn’t appear to be new, but is more likely to occur now due to heavier concurrent chunk loading activity.
Capturing the region as a local variable will prevent this, and if the rebuild is cancelled before our mixin exits then the vanilla logic will detect that and exit without rebuilding.
Even if a rebuild does happen after cancel it doesn’t cause a problem other than wasting compute resources when the chunk is rebuilt and buffered again in a frame or two.
I can include this with the item rendering fix unless you want to segregate or fast track it.