Interface FluidVariantRenderHandler


public interface FluidVariantRenderHandler
Defines how fluid variants of a given Fluid should be displayed to clients. Register with FluidVariantRendering.register(Fluid, FluidVariantRenderHandler).
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    appendTooltip(FluidVariant fluidVariant, List<net.minecraft.network.chat.Component> tooltip, net.minecraft.world.item.TooltipFlag tooltipFlag)
    Append additional tooltips to the passed list if additional information is contained in the fluid variant.
    default int
    getColor(FluidVariant fluidVariant, @Nullable net.minecraft.client.renderer.block.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos)
    Return the color to use when rendering the sprites of this fluid variant.
  • Method Details

    • appendTooltip

      default void appendTooltip(FluidVariant fluidVariant, List<net.minecraft.network.chat.Component> tooltip, net.minecraft.world.item.TooltipFlag tooltipFlag)
      Append additional tooltips to the passed list if additional information is contained in the fluid variant.

      The name of the fluid, and its identifier if the tooltip context is advanced, should not be appended. They are already added by FluidVariantRendering.getTooltip(FluidVariant).

    • getColor

      default int getColor(FluidVariant fluidVariant, @Nullable net.minecraft.client.renderer.block.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos)
      Return the color to use when rendering the sprites of this fluid variant. Transparency (alpha) will generally be taken into account and should be specified as well.

      The level and position are optional context parameters and may be null. If they are null, this method must return a location-independent color. If they are provided, this method may return a color that depends on the location. For example, water returns the biome-dependent color if the context parameters are specified, or its default color if one of them is null.