Galacticraft crash
kelvinkelvin2 opened this issue ยท 4 comments
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
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
:
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:
So in other words, I need to set up my animations later than in postInit
, and that probably means lazy-loading.
Thanks for finding the fix for this, will turn player animations off, for now, hopefully, you can get the patch out soon!
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.