Add null check in BlockSpring#getBlockColor (#321)

This commit is contained in:
Martijn van den Brand 2023-09-19 21:50:01 +02:00 committed by GitHub
parent 5f9897ca1c
commit 2a0f63e9f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,7 +33,7 @@ public class BlockSpring extends BlockContainerImpl implements ICustomBlockState
@Override
@OnlyIn(Dist.CLIENT)
public BlockColor getBlockColor() {
return (state, level, pos, i) -> BiomeColors.getAverageWaterColor(level, pos);
return (state, level, pos, i) -> level == null || pos == null ? -1 : BiomeColors.getAverageWaterColor(level, pos);
}
@Override