BlockSpring's BlockColor errors when world argument is null
SuperMartijn642 opened this issue ยท 0 comments
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.
The implementation of BlockColor#getColor
in BlockSpring#getBlockColor
calls BiomeColors#getAverageWaterColor
with the world argument. Whenever the world argument is null for BiomeColors#getAverageWaterColor
, this leads to a null pointer exception.
This seems like a simple oversight as BlockGoldenLeaves#getBlockColor
does have a null check.
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: SuperMartijn642/Entangled#64