类 FluidInteractionRegistry

java.lang.Object
net.neoforged.neoforge.fluids.FluidInteractionRegistry

public final class FluidInteractionRegistry extends Object
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.

  • 字段详细资料

  • 构造器详细资料

    • FluidInteractionRegistry

      public FluidInteractionRegistry()
  • 方法详细资料

    • addInteraction

      public static void addInteraction(FluidType source, FluidInteractionRegistry.InteractionInformation interaction)
      Adds an interaction between a source and its surroundings.
      参数:
      source - the source of the interaction, this will be replaced if the interaction occurs
      interaction - the interaction data to check and perform
    • canInteract

      public static boolean canInteract(Level level, BlockPos pos)
      Performs all potential fluid interactions at a given position.

      Note: Only the first interaction check that succeeds will occur.

      参数:
      level - the level the interactions take place in
      pos - the position of the source fluid
      返回:
      true if an interaction took place, false otherwise