bernie-g/geckolib

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

iron431 opened this issue · 2 comments

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

fixed by switching away from deprecated initializeClient and using createGeoRenderer

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.