Class FluidVariantRendering

java.lang.Object
net.fabricmc.fabric.api.transfer.v1.client.fluid.FluidVariantRendering

@Experimental @Deprecated @Environment(CLIENT) public class FluidVariantRendering extends Object
Deprecated.
Experimental feature, we reserve the right to remove or change it without further notice. The transfer API is a complex addition, and we want to be able to correct possible design mistakes.
Client-side display of fluid variants.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    fillsFromTop​(FluidVariant fluidVariant)
    Deprecated.
    Return true if this fluid variant should be rendered as filling tanks from the top.
    static int
    getColor​(FluidVariant fluidVariant)
    Deprecated.
    Return the position-independent color that should be used to render the sprite of the passed fluid variant.
    static int
    getColor​(FluidVariant fluidVariant, @Nullable net.minecraft.world.BlockRenderView view, @Nullable net.minecraft.util.math.BlockPos pos)
    Deprecated.
    Return the color that should be used when rendering the sprite of the passed fluid variant.
    static @Nullable FluidVariantRenderHandler
    getHandler​(net.minecraft.fluid.Fluid fluid)
    Deprecated.
    Return the render handler for the passed fluid, if available, and null otherwise.
    getHandlerOrDefault​(net.minecraft.fluid.Fluid fluid)
    Deprecated.
    Return the render handler for the passed fluid, if available, or the default instance otherwise.
    static net.minecraft.text.Text
    getName​(FluidVariant fluidVariant)
    Deprecated.
    Return the name of the passed fluid variant.
    static @Nullable net.minecraft.client.texture.Sprite
    getSprite​(FluidVariant fluidVariant)
    Deprecated.
    Return the sprite that should be used to render the passed fluid variant, or null if it's not available.
    static List<net.minecraft.text.Text>
    getTooltip​(FluidVariant fluidVariant)
    Deprecated.
    Return a mutable list: the tooltip for the passed fluid variant, including the name and additional lines if available and the id of the fluid if advanced tooltips are enabled.
    static List<net.minecraft.text.Text>
    getTooltip​(FluidVariant fluidVariant, net.minecraft.client.item.TooltipContext context)
    Deprecated.
    Return a mutable list: the tooltip for the passed fluid variant, including the name and additional lines if available and the id of the fluid if advanced tooltips are enabled.
    static void
    register​(net.minecraft.fluid.Fluid fluid, FluidVariantRenderHandler handler)
    Deprecated.
    Register a render handler for the passed fluid.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FluidVariantRendering

      public FluidVariantRendering()
      Deprecated.
  • Method Details

    • register

      public static void register(net.minecraft.fluid.Fluid fluid, FluidVariantRenderHandler handler)
      Deprecated.
      Register a render handler for the passed fluid.
    • getHandler

      @Nullable public static @Nullable FluidVariantRenderHandler getHandler(net.minecraft.fluid.Fluid fluid)
      Deprecated.
      Return the render handler for the passed fluid, if available, and null otherwise.
    • getHandlerOrDefault

      public static FluidVariantRenderHandler getHandlerOrDefault(net.minecraft.fluid.Fluid fluid)
      Deprecated.
      Return the render handler for the passed fluid, if available, or the default instance otherwise.
    • getName

      public static net.minecraft.text.Text getName(FluidVariant fluidVariant)
      Deprecated.
      Return the name of the passed fluid variant.
    • getTooltip

      public static List<net.minecraft.text.Text> getTooltip(FluidVariant fluidVariant)
      Deprecated.
      Return a mutable list: the tooltip for the passed fluid variant, including the name and additional lines if available and the id of the fluid if advanced tooltips are enabled.

      Compared to the other overload, the current tooltip context is automatically used.

    • getTooltip

      public static List<net.minecraft.text.Text> getTooltip(FluidVariant fluidVariant, net.minecraft.client.item.TooltipContext context)
      Deprecated.
      Return a mutable list: the tooltip for the passed fluid variant, including the name and additional lines if available and the id of the fluid if advanced tooltips are enabled.
    • getSprite

      @Nullable public static @Nullable net.minecraft.client.texture.Sprite getSprite(FluidVariant fluidVariant)
      Deprecated.
      Return the sprite that should be used to render the passed fluid variant, or null if it's not available. The sprite should be rendered using the color returned by getColor(net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant).
    • getColor

      public static int getColor(FluidVariant fluidVariant)
      Deprecated.
      Return the position-independent color that should be used to render the sprite of the passed fluid variant.
    • getColor

      public static int getColor(FluidVariant fluidVariant, @Nullable @Nullable net.minecraft.world.BlockRenderView view, @Nullable @Nullable net.minecraft.util.math.BlockPos pos)
      Deprecated.
      Return the color that should be used when rendering the sprite of the passed fluid variant.

      If the world and the position parameters are null, a position-independent color is returned. If the world and position parameters are not null, the color may depend on the position. For example, if world and position are passed, water will use them to return a biome-dependent color.

    • fillsFromTop

      public static boolean fillsFromTop(FluidVariant fluidVariant)
      Deprecated.
      Return true if this fluid variant should be rendered as filling tanks from the top.