Class CreateFluidSourceEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.block.CreateFluidSourceEvent

public class CreateFluidSourceEvent extends BlockEvent
Fired when a fluid checks if nearby blocks can convert it to a source block.

This can be used to manipulate if fluids are allowed to create sources dynamically.

  • Field Details

    • vanillaResult

      private final boolean vanillaResult
    • canConvert

      private boolean canConvert
  • Constructor Details

  • Method Details

    • getLevel

      public Level getLevel()
      Overrides:
      getLevel in class BlockEvent
    • getFluidState

      public FluidState getFluidState()
    • getVanillaResult

      public boolean getVanillaResult()
      Returns if the fluid would normally be converted to a source block.

      This is computed by calling IFluidStateExtension.canConvertToSource(Level, BlockPos).

    • canConvert

      public boolean canConvert()
      Returns if the fluid will be converted to a source block.
      Returns:
      if the fluid will be converted to a source block
    • setCanConvert

      public void setCanConvert(boolean convert)
      Sets if the fluid will be converted to a source block.
      Parameters:
      convert - True to permit the conversion, false otherwise.