Skip to content

FluidStackTexture

Since 2.2.1

FluidStackTexture renders one or more FluidStacks as a GUI texture using the standard Minecraft fluid rendering. When multiple stacks are provided, they cycle every 20 ticks (1 second).

Registry name: fluid_stack_texture

INFO

Extends TransformTexture — supports rotate(), scale(), transform().


Usage

java
// Single fluid
IGuiTexture water = new FluidStackTexture(Fluids.WATER);

// Multiple fluids — cycle every 20 ticks
IGuiTexture cycle = new FluidStackTexture(
    Fluids.WATER, Fluids.LAVA
);

// From FluidStacks (custom amount)
IGuiTexture exact = new FluidStackTexture(
    new FluidStack(Fluids.WATER, 1000)
);

// Tinted
IGuiTexture tinted = new FluidStackTexture(Fluids.WATER)
    .setColor(0x8000AAFF);

Fields

NameTypeDescription
fluidsFluidStack[]The fluid stacks to display.

Methods

MethodReturnsDescription
setFluids(FluidStack...)FluidStackTextureReplaces the displayed stacks and resets the cycle index.
setColor(int)FluidStackTextureSets an ARGB tint applied over the rendered fluid.
copy()FluidStackTextureReturns a deep copy.

Released under the MIT License.