The BlockColor#getColor method takes 4 arguments, 2 of these are marked @Nullable which includes the world (BlockAndTintGetter) argument. This can indeed be null, for example when called from inside the BlockRenderDispatcher#renderSingleBlock method which doesn't take a world argument.
In my mod Entangled I happen to use BlockRenderDispatcher#renderSingleBlock to render other blocks in the world. When the rendered block is the BlockSpring from Nature's Aura, this leads to a crash.
Original issue here: https://github.com/SuperMartijn642/Entangled/issues/64
The
BlockColor#getColor
method takes 4 arguments, 2 of these are marked@Nullable
which includes the world (BlockAndTintGetter
) argument. This can indeed be null, for example when called from inside theBlockRenderDispatcher#renderSingleBlock
method which doesn't take a world argument.The implementation of
BlockColor#getColor
inBlockSpring#getBlockColor
callsBiomeColors#getAverageWaterColor
with the world argument. Whenever the world argument is null forBiomeColors#getAverageWaterColor
, this leads to a null pointer exception. https://github.com/Ellpeck/NaturesAura/blob/5f9897ca1c51cc94bb5a0ac8480b69ae87476a3d/src/main/java/de/ellpeck/naturesaura/blocks/BlockSpring.java#L33-L37This seems like a simple oversight as
BlockGoldenLeaves#getBlockColor
does have a null check. https://github.com/Ellpeck/NaturesAura/blob/5f9897ca1c51cc94bb5a0ac8480b69ae87476a3d/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldenLeaves.java#L74-L82In my mod Entangled I happen to use
BlockRenderDispatcher#renderSingleBlock
to render other blocks in the world. When the rendered block is theBlockSpring
from Nature's Aura, this leads to a crash. Original issue here: https://github.com/SuperMartijn642/Entangled/issues/64