|
@@ -116,7 +116,9 @@ public class FluidStackHooksImpl {
|
|
|
@Nullable
|
|
|
public static TextureAtlasSprite getStillTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, @NotNull FluidState state) {
|
|
|
if (state.getType() == Fluids.EMPTY) return null;
|
|
|
- TextureAtlasSprite[] sprites = FluidRenderHandlerRegistry.INSTANCE.get(state.getType()).getFluidSprites(level, pos, state);
|
|
|
+ FluidRenderHandler handler = FluidRenderHandlerRegistry.INSTANCE.get(state.getType());
|
|
|
+ if (handler == null) return null;
|
|
|
+ TextureAtlasSprite[] sprites = handler.getFluidSprites(level, pos, state);
|
|
|
if (sprites == null) return null;
|
|
|
return sprites[0];
|
|
|
}
|
|
@@ -125,7 +127,9 @@ public class FluidStackHooksImpl {
|
|
|
@Nullable
|
|
|
public static TextureAtlasSprite getStillTexture(@NotNull FluidStack stack) {
|
|
|
if (stack.getFluid() == Fluids.EMPTY) return null;
|
|
|
- TextureAtlasSprite[] sprites = FluidRenderHandlerRegistry.INSTANCE.get(stack.getFluid()).getFluidSprites(null, null, stack.getFluid().defaultFluidState());
|
|
|
+ FluidRenderHandler handler = FluidRenderHandlerRegistry.INSTANCE.get(stack.getFluid());
|
|
|
+ if (handler == null) return null;
|
|
|
+ TextureAtlasSprite[] sprites = handler.getFluidSprites(null, null, stack.getFluid().defaultFluidState());
|
|
|
if (sprites == null) return null;
|
|
|
return sprites[0];
|
|
|
}
|
|
@@ -134,7 +138,9 @@ public class FluidStackHooksImpl {
|
|
|
@Nullable
|
|
|
public static TextureAtlasSprite getStillTexture(@NotNull Fluid fluid) {
|
|
|
if (fluid == Fluids.EMPTY) return null;
|
|
|
- TextureAtlasSprite[] sprites = FluidRenderHandlerRegistry.INSTANCE.get(fluid).getFluidSprites(null, null, fluid.defaultFluidState());
|
|
|
+ FluidRenderHandler handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
|
|
|
+ if (handler == null) return null;
|
|
|
+ TextureAtlasSprite[] sprites = handler.getFluidSprites(null, null, fluid.defaultFluidState());
|
|
|
if (sprites == null) return null;
|
|
|
return sprites[0];
|
|
|
}
|
|
@@ -165,7 +171,9 @@ public class FluidStackHooksImpl {
|
|
|
@Nullable
|
|
|
public static TextureAtlasSprite getFlowingTexture(@NotNull Fluid fluid) {
|
|
|
if (fluid == Fluids.EMPTY) return null;
|
|
|
- TextureAtlasSprite[] sprites = FluidRenderHandlerRegistry.INSTANCE.get(fluid).getFluidSprites(null, null, fluid.defaultFluidState());
|
|
|
+ FluidRenderHandler handler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
|
|
|
+ if (handler == null) return null;
|
|
|
+ TextureAtlasSprite[] sprites = handler.getFluidSprites(null, null, fluid.defaultFluidState());
|
|
|
if (sprites == null) return null;
|
|
|
return sprites[1];
|
|
|
}
|