Floating flowers cause crash when their model/color is retrieved by a PrimitiveMobs chameleon
Reassembly opened this issue ยท 2 comments
Chameleons from PrimitiveMobs attempt to change color based on the color of the block they're standing on. When one stands on a floating flower, it causes a NullPointerException immediately and on world reload, unless/until chameleons are removed or disabled from that world.
Tentatively reported here rather than at the PrimitiveMobs issue tracker, as it appears that this issue could hypothetically also occur if other mods attempt to fetch model/block color from floating flowers in this way.
Version Information
Forge version: 1.12.2-14.23.3.2655, 1.12.2-14.23.4.2703
Botania version: r1.10-354
PrimitiveMobs version: 1.1.6_beta
Further Information
Link to crash log: https://gist.github.com/Reassembly/d0460a214d48af049aff35a680a2a03a
Steps to reproduce:
- Move a PrimitiveMobs chameleon onto a Botania floating flower.
What I expected to happen: The chameleon would either take on the color of the floating flower or the color of the floating flower's grass type. (Technically this was not actually expected, as the chameleon jumped onto the floating flower of its own volition, and was not pushed/placed there deliberately.)
What happened instead: The game client crashed, apparently due to a NullPointerException in FloatingFlowerModel.getModel.
The chameleon needs to call getExtendedState before asking for the color here
Generally, querying rendering-related things like the color multiplier needs to be passed extended states (though botania could do with some safety checks in there)
here as well needs to be extended state aware.