question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.15pre-1 batching chunks NPE

See original GitHub issue

Versions:

  • 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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
modmuss50commented, Nov 26, 2019

I can push it right out, glad to know that it is the correct fix, I wasnt too sure.

0reactions
grondagcommented, Nov 26, 2019

Assgining region to a local var is a quick fix but it didnt feel right.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found