Package net.neoforged.neoforge.fluids
Record Class FluidInteractionRegistry.InteractionInformation
java.lang.Object
java.lang.Record
net.neoforged.neoforge.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
FieldsModifier and TypeFieldDescriptionprivate final FluidInteractionRegistry.FluidInteractionThe field for theinteractionrecord component.private final FluidInteractionRegistry.HasFluidInteractionThe field for thepredicaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionInteractionInformation(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 aInteractionInformationrecord 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 booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinteractionrecord component.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
predicate
The field for thepredicaterecord component. -
interaction
The field for theinteractionrecord 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 aInteractionInformationrecord class.- Parameters:
predicate- the value for thepredicaterecord componentinteraction- the value for theinteractionrecord 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 thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
interaction
Returns the value of theinteractionrecord component.- Returns:
- the value of the
interactionrecord component
-