Polymorph (Fabric 1.16.1 - 1.19.2)

Polymorph (Fabric 1.16.1 - 1.19.2)

12M Downloads

[Bug]: Random NullPointerException on startup remove all block entities content

neomatamune opened this issue ยท 3 comments

commented

Minecraft Version

1.20.1

What happened?

Randomly at startup of a map we get a NullPointerException while going through the capabilities of items. The bug appear at fairly random times sometimes weeks can go without it triggering. But every time it triggers we have a NullPointerException on polymorph.
After the bug triggers the game crashes and on reload of the same map all tile entities are now reset, so any custom data inside disappear.

How do you trigger this bug?

Since the bug appears randomly we have not found a way to reproduce it systematically... But at some point in the execution the content of PolymorphCommon.blockEntity2RecipeData contains a null element that trigger the NPE while PolymorphCommon.tryCreateRecipeData is running resulting in an issue with all following block entities.

Loader

Forge

Loader Version

Forge-47.3.25

API Version

N/A

Mod Version

0.49.8+1.20.1

Relevant Log Outputs

Limited the logs at the NullPointerException stacktrace :
https://gist.github.com/neomatamune/8788202af63cc35df71fced9f7a58efc

commented

Just adding a comment here : I'm still trying to reproduce the issue systematically but without success so far. The randomness of the bug makes it fairly hard to track and such I just pointed here that those lists could have null values in them resulting in the current error (and maybe ending in the subsequent issues)
I'm still looking at why a null value can be added to that list and tracking the mod that is surely responsible for that.

commented

I'm not entirely sure which mod could be adding null values to the list, but as a hotfix I've simply added some new null checks to ensure that those cannot be populated in the first place. Please try out the 0.49.9 version and see if the issue resolves fully.

commented

Thanks, I'll continue my investigation to find the mod responsible, but at least that should help avoiding full map crashes now :)