Package net.neoforged.neoforge.fluids
Class FluidInteractionRegistry
java.lang.Object
net.neoforged.neoforge.fluids.FluidInteractionRegistry
A registry which defines the interactions a source fluid can have with its
 surroundings. Each possible flow direction is checked for all interactions with
 the source.
 
Fluid interactions mimic the behavior of LiquidBlock#shouldSpreadLiquid.
 As such, all directions, besides Direction.DOWN is tested and then replaced.
 Any fluids which cause a change in the down interaction must be handled in
 FlowingFluid#spreadTo and not by this interaction manager.
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface which performs an interaction for a source.static interfaceAn interface which tests whether a source fluid can interact with its surroundings.static final recordHolds the interaction data for a given source type on when to succeed and what to perform. - 
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<FluidType,List<FluidInteractionRegistry.InteractionInformation>>  - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddInteraction(FluidType source, FluidInteractionRegistry.InteractionInformation interaction) Adds an interaction between a source and its surroundings.static booleancanInteract(Level level, BlockPos pos) Performs all potential fluid interactions at a given position. 
- 
Field Details
- 
INTERACTIONS
private static final Map<FluidType,List<FluidInteractionRegistry.InteractionInformation>> INTERACTIONS 
 - 
 - 
Constructor Details
- 
FluidInteractionRegistry
public FluidInteractionRegistry() 
 - 
 - 
Method Details
- 
addInteraction
public static void addInteraction(FluidType source, FluidInteractionRegistry.InteractionInformation interaction) Adds an interaction between a source and its surroundings.- Parameters:
 source- the source of the interaction, this will be replaced if the interaction occursinteraction- the interaction data to check and perform
 - 
canInteract
Performs all potential fluid interactions at a given position.Note: Only the first interaction check that succeeds will occur.
- Parameters:
 level- the level the interactions take place inpos- the position of the source fluid- Returns:
 trueif an interaction took place,falseotherwise
 
 -