Record Class FluidPhysics
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.resource.fluid.FluidPhysics
- Record Components:
viscosity- how it moves things inside itspread- how fast and how far it flowsinfiniteSource- whether two of its sources make a new source of it, like watermixedSource- what a source formed between it and another fluid becomes
public record FluidPhysics(@NotNull Viscosity viscosity, @NotNull Spread spread, boolean infiniteSource, @NotNull FluidPhysics.MixedSource mixedSource)
extends Record
How a placed fluid behaves in the world. Read at runtime, so
fluids.yml changes apply on
/machineengine reload fluids.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat a source formed between two different fluids (or a fluid and plain water) becomes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FluidPhysicsWater's behavior; a source between two different fluids forms nothing. -
Constructor Summary
ConstructorsConstructorDescriptionFluidPhysics(@NotNull Viscosity viscosity, @NotNull Spread spread, boolean infiniteSource, @NotNull FluidPhysics.MixedSource mixedSource) Creates an instance of aFluidPhysicsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinfiniteSourcerecord component.@NotNull FluidPhysics.MixedSourceReturns the value of themixedSourcerecord component.@NotNull Spreadspread()Returns the value of thespreadrecord component.final StringtoString()Returns a string representation of this record class.@NotNull ViscosityReturns the value of theviscosityrecord component.
-
Field Details
-
WATER
Water's behavior; a source between two different fluids forms nothing.
-
-
Constructor Details
-
FluidPhysics
public FluidPhysics(@NotNull @NotNull Viscosity viscosity, @NotNull @NotNull Spread spread, boolean infiniteSource, @NotNull @NotNull FluidPhysics.MixedSource mixedSource) Creates an instance of aFluidPhysicsrecord class.- Parameters:
viscosity- the value for theviscosityrecord componentspread- the value for thespreadrecord componentinfiniteSource- the value for theinfiniteSourcerecord componentmixedSource- the value for themixedSourcerecord component
-
-
Method Details
-
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. -
viscosity
-
spread
-
infiniteSource
public boolean infiniteSource()Returns the value of theinfiniteSourcerecord component.- Returns:
- the value of the
infiniteSourcerecord component
-
mixedSource
Returns the value of themixedSourcerecord component.- Returns:
- the value of the
mixedSourcerecord component
-