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 SummaryNested 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 SummaryFieldsModifier and TypeFieldDescriptionprivate static final Map<FluidType,List<FluidInteractionRegistry.InteractionInformation>> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
INTERACTIONSprivate static final Map<FluidType,List<FluidInteractionRegistry.InteractionInformation>> INTERACTIONS
 
- 
- 
Constructor Details- 
FluidInteractionRegistrypublic FluidInteractionRegistry()
 
- 
- 
Method Details- 
addInteractionpublic 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 occurs
- interaction- the interaction data to check and perform
 
- 
canInteractPerforms 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 in
- pos- the position of the source fluid
- Returns:
- trueif an interaction took place,- falseotherwise
 
 
-