Record Class FluidPhysics

java.lang.Object
java.lang.Record
fr.robie.machineengine.api.resource.fluid.FluidPhysics
Record Components:
viscosity - how it moves things inside it
spread - how fast and how far it flows
infiniteSource - whether two of its sources make a new source of it, like water
mixedSource - 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.
  • Field Details

    • WATER

      public static final FluidPhysics 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 a FluidPhysics record class.
      Parameters:
      viscosity - the value for the viscosity record component
      spread - the value for the spread record component
      infiniteSource - the value for the infiniteSource record component
      mixedSource - the value for the mixedSource record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • viscosity

      @NotNull public @NotNull Viscosity viscosity()
      Returns the value of the viscosity record component.
      Returns:
      the value of the viscosity record component
    • spread

      @NotNull public @NotNull Spread spread()
      Returns the value of the spread record component.
      Returns:
      the value of the spread record component
    • infiniteSource

      public boolean infiniteSource()
      Returns the value of the infiniteSource record component.
      Returns:
      the value of the infiniteSource record component
    • mixedSource

      @NotNull public @NotNull FluidPhysics.MixedSource mixedSource()
      Returns the value of the mixedSource record component.
      Returns:
      the value of the mixedSource record component