Electroblob's Wizardry

Electroblob's Wizardry

18M Downloads

Galacticraft crash

kelvinkelvin2 opened this issue ยท 4 comments

commented

Minecraft version: 1.12.2
Wizardry version: 4.3.1
Environment: Server

Issue details: opening inventory
java.lang.NullPointerException: Rendering entity in world
at electroblob.wizardry.client.animation.PlayerAnimator.onRenderPlayerPostEvent(PlayerAnimator.java:234)
Entity Type: null (micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP)
Galacticraft renames the playermodel..

Other mods involved: galacticraft

Link to crash report (if applicable): https://pastebin.pl/view/d48df438

commented

Okay, I've done some digging and found a way to not only fix the crash, but also make the animations compatible (I think!). In case anyone was wondering, and partly for my own future reference, here's an explanation:

This issue happens because Galacticraft replaces the player renderer (it may well replace the model too but that's actually not a problem). It's exactly the same crash as #518, but in RenderPlayerEvent.Post instead of Pre, because I didn't realise I'd also accessed my layers list there.

Now, Galacticraft is well-behaved and it correctly assigns its new renderer to all the relevant fields in RenderManager:

https://github.com/micdoodle8/Galacticraft/blob/467736124c3ca842b27adcec6ece06d1e45f049a/src/main/java/micdoodle8/mods/galacticraft/core/proxy/ClientProxyCore.java#L223-L234

Importantly, this includes skinMap, which is what I access to get the layers in PlayerAnimator#init, so in theory it should work. However, Galacticraft does this in its postInit, which means I can't guarantee I'll access skinMap after Galacticraft has done its thing. I actually wrote a comment to this effect when I made the player animation system:

// TODO: Figure out if calling this from postInit ensures we catch all the layers, and lazy-load it if not

So in other words, I need to set up my animations later than in postInit, and that probably means lazy-loading.

commented

Thanks for finding the fix for this, will turn player animations off, for now, hopefully, you can get the patch out soon!

commented

Okay, Galacticraft is clearly overwriting the player model with its own version, hence the crash when wizardry tries to animate it. For now, you can disable player animations in wizardry's config and it should avoid this issue.

commented

This is happening a lot, I've made it a priority to fix.