Package net.minecraftforge.fluids
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 occurinteraction
- 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 Summary
Modifier and TypeFieldDescriptionprivate final FluidInteractionRegistry.FluidInteraction
The field for theinteraction
record component.private final FluidInteractionRegistry.HasFluidInteraction
The field for thepredicate
record component. -
Constructor Summary
ConstructorDescriptionInteractionInformation
(FluidInteractionRegistry.HasFluidInteraction predicate, Function<FluidState, BlockState> getState) Constructor which transforms the source state into a block.InteractionInformation
(FluidInteractionRegistry.HasFluidInteraction predicate, BlockState state) Constructor which transforms the source state into a block.InteractionInformation
(FluidInteractionRegistry.HasFluidInteraction predicate, FluidInteractionRegistry.FluidInteraction interaction) Creates an instance of aInteractionInformation
record class.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.InteractionInformation
(FluidType type, BlockState state) Constructor which checks the surroundings fluids for a specific type and then transforms the source state into a block. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinteraction
record component.Returns the value of thepredicate
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
predicate
The field for thepredicate
record component. -
interaction
The field for theinteraction
record component.
-
-
Constructor Details
-
InteractionInformation
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 sourcestate
- 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 occurstate
- the state of the block replacing the source
-
InteractionInformation
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 sourcegetState
- 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 occurgetState
- a function to transform the source fluid into a block state
-
InteractionInformation
public InteractionInformation(FluidInteractionRegistry.HasFluidInteraction predicate, FluidInteractionRegistry.FluidInteraction interaction) Creates an instance of aInteractionInformation
record class.- Parameters:
predicate
- the value for thepredicate
record componentinteraction
- the value for theinteraction
record component
-
-
Method Details
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
predicate
Returns the value of thepredicate
record component.- Returns:
- the value of the
predicate
record component
-
interaction
Returns the value of theinteraction
record component.- Returns:
- the value of the
interaction
record component
-