Shadows-of-Fire / Placebo

A library mod
MIT License
23 stars 22 forks source link

Crash when trying to create random loot #56

Closed WTFSajuuk closed 1 year ago

WTFSajuuk commented 1 year ago

When a listener tries to create random loot it crashes the server with a "java.util.NoSuchElementException: No value present" This only happens in dimensions other than the overworld i.e nether or end

In the exception that is shown(see attached log) it appears that apotheosis/placebo might not be the cause of the "no value" in the object but apotheosis/placebo is the cause of the crash and the crash can be avoided with some simple error handling

The easiest fix would most likely to wrap the get on the optional object in WeightedJsonReloadListener with a hasvalue before returning

exception.log Same error logged her with more logs: https://forums.minecraftforge.net/topic/120118-it-says-connection-lost-server-closed-after-3-seconds-everytime-i-enter-a-dimensionother-than-the-overworld/

Not sure if this bug should be logged against apotheosis or placebo so logging it on both feel free to close one if it belongs on the other: see https://github.com/Shadows-of-Fire/Apotheosis/issues/767