Sk1erLLC / Patcher

A Forge mod full of Vanilla bug fixes, Quality of Life improvements, and performance enhancements.
Other
232 stars 60 forks source link

HUD Caching crash during startup #146

Closed hannibal002 closed 1 year ago

hannibal002 commented 1 year ago
[11:02:21] [Client thread/FATAL]: Unreported exception thrown!
java.lang.NullPointerException
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:140) ~[EventBus.class:?]
    at net.minecraftforge.client.GuiIngameForge.pre(GuiIngameForge.java:847) ~[GuiIngameForge.class:?]
    at net.minecraftforge.client.GuiIngameForge.renderGameOverlay(GuiIngameForge.java:98) ~[GuiIngameForge.class:?]
    at club.sk1er.patcher.screen.render.caching.HUDCaching.renderCachedHud(HUDCaching.java:100) ~[HUDCaching.class:?]
    at net.minecraft.client.renderer.EntityRenderer.redirect$bda000$patcher$renderCachedHUD(EntityRenderer.java:10558) ~[bfk.class:?]
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1401) ~[bfk.class:?]
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1051) ~[ave.class:?]
Sychic commented 1 year ago

Is there a way to reproduce this? and does this happen with only patcher?

I'm unable to find any reason why this might happen.

hannibal002 commented 1 year ago

Sadly no.

I used the same version of patcher for months and restarting with patched 5-20 times a day (testing mods) and it only happened 2-3 times in the last year over multiple versions of patcher. After the crash today, I tried starting again without touching mods at all and it worked fine the second time. Therefore, I think the crash it is not linked to other mods, at least not directly.

It feels like a 1/1000 chance edge case thingy. Maybe just throw a catch block around this case?

Sychic commented 1 year ago

Can't just blindly catch an exception which might stem from a deeper cause...

If it's not consistent then it's likely not patcher's issue and you may want to update if you haven't already.

hannibal002 commented 1 year ago

You think ignoring this crash could corrupt other mods/config files down the line?

Maybe a race condition like behaviour with mixin?

Sychic commented 1 year ago

There's no mixin involved here, it's something completely different (at least afaict). I doubt it's that big of an issue because there's no data involved here (if you're reading or writing files in render, you should really reconsider your setup).