Mekanism Tools

Mekanism Tools

77M Downloads

[1.16.5] Exception while ticking EnergyNetwork

KR33PYK1NG opened this issue ยท 3 comments

commented

Issue description:

Post server tick fails to succeed because lazy optional's getValue returns null unexpectedly.

Steps to reproduce:

I don't know how to reproduce this, I encountered this randomly the first time today.

Version (make sure you are on the latest version before reporting):

Forge: 36.0.46
Mekanism: 10.0.19.446

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

https://pastebin.com/KYNwyGsp

commented

I tried looking into this more but honestly I don't see how this is even possible unless someone is doing something dumb and providing null as their implementation of the energy cap. There certainly isn't anything that can be done on our end to fix this or even add better logging.

commented

For starters I would try updating to Mekanism 10.0.21, but the error that is happening is because something is causing some mod to return null from a lazy optional which should never be null. When I set someone a build with more debugging it seemed to be related to industrial foregoing's block placer, though when I looked at the code for how that block handles energy it should be fine. I am going to leave this open for now as a reminder to look into it slightly further just in case it has something to do with how we map/wrap our lazy optionals or maybe something forge changed but I doubt it.

commented

As soon as I bumped into this issue, I experimented with removal of IllegalStateException from getValueUnsafe (Forge src code) and it seemingly helped.