From e9a29560f164cafc38fcca12bb3b0624d6946e7f Mon Sep 17 00:00:00 2001 From: plulsls Date: Tue, 22 Jun 2021 16:53:25 +0800 Subject: [PATCH] fix #3 --- .../highlightLavaSource/LavaSourceResourceLoader.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/plusls/ommc/feature/highlightLavaSource/LavaSourceResourceLoader.java b/src/main/java/com/plusls/ommc/feature/highlightLavaSource/LavaSourceResourceLoader.java index fe9eb93..d66db2f 100644 --- a/src/main/java/com/plusls/ommc/feature/highlightLavaSource/LavaSourceResourceLoader.java +++ b/src/main/java/com/plusls/ommc/feature/highlightLavaSource/LavaSourceResourceLoader.java @@ -21,6 +21,7 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockRenderView; +import org.jetbrains.annotations.Nullable; import java.util.function.Function; @@ -63,10 +64,10 @@ public void reload(ResourceManager manager) { defaultLavaSourceSpites[1] = defaultLavaSourceFlowSprite; FluidRenderHandler lavaSourceRenderHandler = new FluidRenderHandler() { @Override - public Sprite[] getFluidSprites(BlockRenderView extendedBlockView, BlockPos blockPos, FluidState fluidState) { + public Sprite[] getFluidSprites(@Nullable BlockRenderView view, @Nullable BlockPos pos, FluidState state) { - if (Configs.FeatureToggle.HIGHLIGHT_LAVA_SOURCE.getBooleanValue()) { - BlockState blockState = extendedBlockView.getBlockState(blockPos); + if (view != null && pos != null && Configs.FeatureToggle.HIGHLIGHT_LAVA_SOURCE.getBooleanValue()) { + BlockState blockState = view.getBlockState(pos); if (blockState.contains(FluidBlock.LEVEL) && blockState.get(FluidBlock.LEVEL) == 0) { return lavaSourceSpites; }