Interface IClientFluidTypeExtensions


public interface IClientFluidTypeExtensions
Client-only extensions to FluidType.
See Also:
  • Field Details

  • Method Details

    • of

    • of

      static IClientFluidTypeExtensions of(Fluid fluid)
    • of

    • getTintColor

      default int getTintColor()
      Returns the tint applied to the fluid's textures.

      The result represents a 32-bit integer where each 8-bits represent the alpha, red, green, and blue channel respectively.

      Returns:
      the tint applied to the fluid's textures in ARGB format
    • getStillTexture

      default ResourceLocation getStillTexture()
      Returns the reference of the texture to apply to a source fluid.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_still will point to assets/minecraft/textures/block/water_still.png).

      Important: This method should only return null for Fluids.EMPTY. All other implementations must define this property.

      Returns:
      the reference of the texture to apply to a source fluid
    • getFlowingTexture

      default ResourceLocation getFlowingTexture()
      Returns the reference of the texture to apply to a flowing fluid.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_flow will point to assets/minecraft/textures/block/water_flow.png).

      Important: This method should only return null for Fluids.EMPTY. All other implementations must define this property.

      Returns:
      the reference of the texture to apply to a flowing fluid
    • getOverlayTexture

      @Nullable default @Nullable ResourceLocation getOverlayTexture()
      Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air. If no reference is specified, either #getStillTexture or #getFlowingTexture will be applied instead.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_overlay will point to assets/minecraft/textures/block/water_overlay.png).

      Returns:
      the reference of the texture to apply to a fluid directly touching a non-opaque block
    • getRenderOverlayTexture

      @Nullable default @Nullable ResourceLocation getRenderOverlayTexture(Minecraft mc)
      Returns the location of the texture to apply to the camera when it is within the fluid. If no location is specified, no overlay will be applied.

      This should return a location to the texture and not a reference (e.g. minecraft:textures/misc/underwater.png will use the texture at assets/minecraft/textures/misc/underwater.png).

      Parameters:
      mc - the client instance
      Returns:
      the location of the texture to apply to the camera when it is within the fluid
    • renderOverlay

      default void renderOverlay(Minecraft mc, PoseStack poseStack)
      Renders #getRenderOverlayTexture onto the camera when within the fluid.
      Parameters:
      mc - the client instance
      poseStack - the transformations representing the current rendering position
    • modifyFogColor

      @NotNull default @NotNull org.joml.Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, org.joml.Vector3f fluidFogColor)
      Modifies the color of the fog when the camera is within the fluid.

      The result expects a three float vector representing the red, green, and blue channels respectively. Each channel should be between [0,1].

      Parameters:
      camera - the camera instance
      partialTick - the delta time of where the current frame is within a tick
      level - the level the camera is located in
      renderDistance - the render distance of the client
      darkenWorldAmount - the amount to darken the world by
      fluidFogColor - the current color of the fog
      Returns:
      the color of the fog
    • modifyFogRender

      default void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape)
      Modifies how the fog is currently being rendered when the camera is within a fluid.
      Parameters:
      camera - the camera instance
      mode - the type of fog being rendered
      renderDistance - the render distance of the client
      partialTick - the delta time of where the current frame is within a tick
      nearDistance - the near plane of where the fog starts to render
      farDistance - the far plane of where the fog ends rendering
      shape - the shape of the fog being rendered
    • getStillTexture

      default ResourceLocation getStillTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos)
      Returns the reference of the texture to apply to a source fluid.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_still will point to assets/minecraft/textures/block/water_still.png).

      Important: This method should only return null for Fluids.EMPTY. All other implementations must define this property.

      Parameters:
      state - the state of the fluid
      getter - the getter the fluid can be obtained from
      pos - the position of the fluid
      Returns:
      the reference of the texture to apply to a source fluid
    • getFlowingTexture

      default ResourceLocation getFlowingTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos)
      Returns the reference of the texture to apply to a flowing fluid.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_flow will point to assets/minecraft/textures/block/water_flow.png).

      Important: This method should only return null for Fluids.EMPTY. All other implementations must define this property.

      Parameters:
      state - the state of the fluid
      getter - the getter the fluid can be obtained from
      pos - the position of the fluid
      Returns:
      the reference of the texture to apply to a flowing fluid
    • getOverlayTexture

      default ResourceLocation getOverlayTexture(FluidState state, BlockAndTintGetter getter, BlockPos pos)
      Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air. If no reference is specified, either #getStillTexture or #getFlowingTexture will be applied instead.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_overlay will point to assets/minecraft/textures/block/water_overlay.png).

      Parameters:
      state - the state of the fluid
      getter - the getter the fluid can be obtained from
      pos - the position of the fluid
      Returns:
      the reference of the texture to apply to a fluid directly touching a non-opaque block
    • getTintColor

      default int getTintColor(FluidState state, BlockAndTintGetter getter, BlockPos pos)
      Returns the tint applied to the fluid's textures.

      The result represents a 32-bit integer where each 8-bits represent the alpha, red, green, and blue channel respectively.

      Parameters:
      state - the state of the fluid
      getter - the getter the fluid can be obtained from
      pos - the position of the fluid
      Returns:
      the tint applied to the fluid's textures in ARGB format
    • getTintColor

      default int getTintColor(FluidStack stack)
      Returns the tint applied to the fluid's textures.

      The result represents a 32-bit integer where each 8-bits represent the alpha, red, green, and blue channel respectively.

      Parameters:
      stack - the stack the fluid is in
      Returns:
      the tint applied to the fluid's textures in ARGB format
    • getStillTexture

      default ResourceLocation getStillTexture(FluidStack stack)
      Returns the reference of the texture to apply to a source fluid.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_still will point to assets/minecraft/textures/block/water_still.png).

      Important: This method should only return null for Fluids.EMPTY. All other implementations must define this property.

      Parameters:
      stack - the stack the fluid is in
      Returns:
      the reference of the texture to apply to a source fluid
    • getFlowingTexture

      default ResourceLocation getFlowingTexture(FluidStack stack)
      Returns the reference of the texture to apply to a flowing fluid.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_flow will point to assets/minecraft/textures/block/water_flow.png).

      Important: This method should only return null for Fluids.EMPTY. All other implementations must define this property.

      Parameters:
      stack - the stack the fluid is in
      Returns:
      the reference of the texture to apply to a flowing fluid
    • getOverlayTexture

      default ResourceLocation getOverlayTexture(FluidStack stack)
      Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air. If no reference is specified, either #getStillTexture or #getFlowingTexture will be applied instead.

      This should return a reference to the texture and not the actual texture itself (e.g. minecraft:block/water_overlay will point to assets/minecraft/textures/block/water_overlay.png).

      Parameters:
      stack - the stack the fluid is in
      Returns:
      the reference of the texture to apply to a fluid directly touching a non-opaque block