Record Class FluidInteractionRegistry.InteractionInformation

java.lang.Object
java.lang.Record
net.minecraftforge.fluids.FluidInteractionRegistry.InteractionInformation
Record Components:
predicate - a test to see whether an interaction can occur
interaction - the interaction to perform
Enclosing class:
FluidInteractionRegistry

public static record FluidInteractionRegistry.InteractionInformation(FluidInteractionRegistry.HasFluidInteraction predicate, FluidInteractionRegistry.FluidInteraction interaction) extends Record
Holds the interaction data for a given source type on when to succeed and what to perform.
  • Field Details

  • Constructor Details

    • InteractionInformation

      public InteractionInformation(FluidType type, BlockState state)
      Constructor which checks the surroundings fluids for a specific type and then transforms the source state into a block.
      Parameters:
      type - the type of the fluid that must be surrounding the source
      state - the state of the block replacing the source
    • InteractionInformation

      public InteractionInformation(FluidInteractionRegistry.HasFluidInteraction predicate, BlockState state)
      Constructor which transforms the source state into a block.
      Parameters:
      predicate - a test to see whether an interaction can occur
      state - the state of the block replacing the source
    • InteractionInformation

      public InteractionInformation(FluidType type, Function<FluidState,BlockState> getState)
      Constructor which checks the surroundings fluids for a specific type and then transforms the source state into a block.
      Parameters:
      type - the type of the fluid that must be surrounding the source
      getState - a function to transform the source fluid into a block state
    • InteractionInformation

      public InteractionInformation(FluidInteractionRegistry.HasFluidInteraction predicate, Function<FluidState,BlockState> getState)
      Constructor which transforms the source state into a block.
      Parameters:
      predicate - a test to see whether an interaction can occur
      getState - a function to transform the source fluid into a block state
    • InteractionInformation

      public InteractionInformation(FluidInteractionRegistry.HasFluidInteraction predicate, FluidInteractionRegistry.FluidInteraction interaction)
      Creates an instance of a InteractionInformation record class.
      Parameters:
      predicate - the value for the predicate record component
      interaction - the value for the interaction 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • predicate

      Returns the value of the predicate record component.
      Returns:
      the value of the predicate record component
    • interaction

      Returns the value of the interaction record component.
      Returns:
      the value of the interaction record component