bernie-g / geckolib

GeckoLib is an animation engine for Minecraft mods, with support for complex 3D keyframe-based animations, numerous easings, concurrent animation support, sound and particle keyframes, event keyframes, math-based animations, and more. Available for all major modloaders.
https://geckolib.com
MIT License
609 stars 127 forks source link

Cannot invoke "software.bernie.geckolib.animatable.GeoItem.getTick(Object)" because "animatable" is null #616

Closed iron431 closed 2 months ago

iron431 commented 2 months ago

Neoforge - 21.0.163 geckolib-neoforge-1.21-4.5.8 irons_spellbooks-1.21-3.4.0-all

Normally, the animatable is set in GeoArmorRenderer#prepForRender, then reset to null, but it appears this is bypassed when vanilla attempts to render enchantment glint or trims (simply putting a geo item in the smithing table causes this) because vanilla directly calls to GeoArmorRenderer#renderToBuffer. Therefore the current animatable is still null.

https://gist.github.com/TomatoSoupter/049d5565843d2d5c1bfe9f28d9eab039 https://gist.github.com/iron431/32dec18da4952771044222d7ce8dd113

iron431 commented 2 months ago

fixed by switching away from deprecated initializeClient and using createGeoRenderer

Witixin1512 commented 2 months ago

For clarity, the issue was calling prepForRender, which used to be required by examples before 1.20.4, but now is handled by GeckoLib after the MultiLoader conversion. Mods should not be calling prepForRender in getHumanoidArmorModel/getGeoArmorRenderer in 1.20.5 and above.