Interface FluidVariantRenderHandler
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.
Defines how fluid variants of a given Fluid should be displayed to clients.
Register with
FluidVariantRendering.register(net.minecraft.fluid.Fluid, net.fabricmc.fabric.api.transfer.v1.client.fluid.FluidVariantRenderHandler)
.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
appendTooltip(FluidVariant fluidVariant, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext tooltipContext)
Deprecated.Append additional tooltips to the passed list if additional information is contained in the fluid variant.default boolean
fillsFromTop(FluidVariant fluidVariant)
Deprecated.Returntrue
if this fluid should fill tanks from top.default int
getColor(FluidVariant fluidVariant)
Deprecated, for removal: This API element is subject to removal in a future version.Use and implement the other more general overload.default int
getColor(FluidVariant fluidVariant, @Nullable net.minecraft.world.BlockRenderView view, @Nullable net.minecraft.util.math.BlockPos pos)
Deprecated.Return the color to use when rendering the sprite of this fluid variant.default net.minecraft.text.Text
getName(FluidVariant fluidVariant)
Deprecated.Return the name that should be used for the passed fluid variant.default @Nullable net.minecraft.client.texture.Sprite
getSprite(FluidVariant fluidVariant)
Deprecated.Return the sprite that should be used to render the passed fluid variant, for use in baked models, (block) entity renderers, or user interfaces.
-
Method Details
-
getName
Deprecated.Return the name that should be used for the passed fluid variant. -
appendTooltip
default void appendTooltip(FluidVariant fluidVariant, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext tooltipContext)Deprecated.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(net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant)
. -
getSprite
@Nullable default @Nullable net.minecraft.client.texture.Sprite getSprite(FluidVariant fluidVariant)Deprecated.Return the sprite that should be used to render the passed fluid variant, for use in baked models, (block) entity renderers, or user interfaces.Null may be returned if the fluid variant should not be rendered.
-
getColor
Deprecated, for removal: This API element is subject to removal in a future version.Use and implement the other more general overload. This one will be removed in a future iteration of the API. -
getColor
default int getColor(FluidVariant fluidVariant, @Nullable @Nullable net.minecraft.world.BlockRenderView view, @Nullable @Nullable net.minecraft.util.math.BlockPos pos)Deprecated.Return the color to use when rendering the sprite of this fluid variant. Transparency (alpha) will generally be taken into account and should be specified as well.The world 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. -
fillsFromTop
Deprecated.Returntrue
if this fluid should fill tanks from top.
-