Shadows-of-Fire / Apotheosis

All things that should have been.
Other
155 stars 120 forks source link

Fix for potential softlock #1104

Closed Shmen8980 closed 6 months ago

Shmen8980 commented 6 months ago

There's an error with GatewaysCompat where if entry.getStack() returns a null value the game will become softlocked and crash on world join. Some variation of the following will fix the issue and cause it to properly generate a log event instead of infinitely crashing.

Shadows-of-Fire commented 6 months ago

If getStack() is null you have something exceptionally wrong in your instance. Catching an NPE here is not a correct nor appropriate solution.
The ItemStack codec provided by placebo (ItemAdapter.CODEC) is not able to produce a null either, and that's the only means of creating an AffixLootEntry, unless you have a mod directly instantiating them or something.