Record Class FluidLook
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.resource.fluid.FluidLook
- Record Components:
still- the still texture, ornullfor water'sflow- the flowing texture, ornullfor water'stint- color multiplied over the texture (0xRRGGBB);null: the fluid's menu color without a texture, white with oneopacity- 0 (invisible) to 1 (opaque); water is about 0.7glow- 0 to 1: how much it ignores darkness (1 = fully lit, like a light source)fog- underwater fog color (0xRRGGBB), ornullfor the tint'sframeTime- ticks per animation frame, 1 or more (water: 2)
public record FluidLook(@Nullable FluidTexture still, @Nullable FluidTexture flow, @Nullable Integer tint, double opacity, double glow, @Nullable Integer fog, int frameTime)
extends Record
How a placed fluid looks. Without textures it is drawn with the vanilla water texture tinted with
tint() (or the fluid's menu color): such a fluid needs no texture of its own. Fluids that
look the same share one look in the client (docs/FLUID_TYPES_PLAN.md ยง2.2).
Textures, tint, opacity and glow apply after the pack is rebuilt; the fog after players rejoin (it is sent with the world's biomes at login).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFluidLook(@Nullable FluidTexture still, @Nullable FluidTexture flow, @Nullable Integer tint, double opacity, double glow, @Nullable Integer fog, int frameTime) Creates an instance of aFluidLookrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable FluidTextureflow()Returns the value of theflowrecord component.@Nullable Integerfog()Returns the value of thefogrecord component.intThe fog to use, for a fluid whose menu color iscolor(ornull).intReturns the value of theframeTimerecord component.doubleglow()Returns the value of theglowrecord component.final inthashCode()Returns a hash code value for this object.doubleopacity()Returns the value of theopacityrecord component.@Nullable FluidTexturestill()Returns the value of thestillrecord component.booleantextured()Whether the fluid has a texture of its own (it then takes a tile in the texture grid).@Nullable Integertint()Returns the value of thetintrecord component.intThe tint to draw with, for a fluid whose menu color iscolor(ornull).final StringtoString()Returns a string representation of this record class.@NotNull FluidLook
-
Field Details
-
TINTED_WATER
Water's texture with the fluid's color.
-
-
Constructor Details
-
FluidLook
public FluidLook(@Nullable @Nullable FluidTexture still, @Nullable @Nullable FluidTexture flow, @Nullable @Nullable Integer tint, double opacity, double glow, @Nullable @Nullable Integer fog, int frameTime) Creates an instance of aFluidLookrecord class.- Parameters:
still- the value for thestillrecord componentflow- the value for theflowrecord componenttint- the value for thetintrecord componentopacity- the value for theopacityrecord componentglow- the value for theglowrecord componentfog- the value for thefogrecord componentframeTime- the value for theframeTimerecord component
-
-
Method Details
-
textured
public boolean textured()Whether the fluid has a texture of its own (it then takes a tile in the texture grid). -
tintFor
The tint to draw with, for a fluid whose menu color iscolor(ornull). -
fogFor
The fog to use, for a fluid whose menu color iscolor(ornull). -
withTint
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
still
-
flow
-
tint
-
opacity
-
glow
-
fog
-
frameTime
-