Class BaseFlowingFluid

java.lang.Object
net.minecraft.world.level.material.Fluid
net.minecraft.world.level.material.FlowingFluid
net.neoforged.neoforge.fluids.BaseFlowingFluid
All Implemented Interfaces:
IFluidExtension
Direct Known Subclasses:
BaseFlowingFluid.Flowing, BaseFlowingFluid.Source

public abstract class BaseFlowingFluid extends net.minecraft.world.level.material.FlowingFluid
Base implementation of a FlowingFluid for mods to use.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.level.material.FlowingFluid

    net.minecraft.world.level.material.FlowingFluid.SpreadContext
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final @Nullable Supplier<? extends net.minecraft.world.level.block.LiquidBlock>
     
    private final @Nullable Supplier<? extends net.minecraft.world.item.Item>
     
    private final float
     
    private final Supplier<? extends net.minecraft.world.level.material.Fluid>
     
    private final Supplier<? extends FluidType>
     
    private final int
     
    private final int
     
    private final Supplier<? extends net.minecraft.world.level.material.Fluid>
     
    private final int
     

    Fields inherited from class net.minecraft.world.level.material.FlowingFluid

    FALLING, LEVEL

    Fields inherited from class net.minecraft.world.level.material.Fluid

    FLUID_STATE_REGISTRY, stateDefinition
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    beforeDestroyingBlock(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
    protected boolean
    canBeReplacedWith(net.minecraft.world.level.material.FluidState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.Fluid fluidIn, net.minecraft.core.Direction direction)
     
    protected boolean
    canConvertToSource(net.minecraft.server.level.ServerLevel level)
     
    boolean
    canConvertToSource(net.minecraft.world.level.material.FluidState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos)
    Returns whether the fluid can create a source.
    protected net.minecraft.world.level.block.state.BlockState
    createLegacyBlock(net.minecraft.world.level.material.FluidState state)
     
    net.minecraft.world.item.Item
     
    protected int
    getDropOff(net.minecraft.world.level.LevelReader worldIn)
     
    protected float
     
    net.minecraft.world.level.material.Fluid
     
    Returns the type of this fluid.
    Optional<net.minecraft.sounds.SoundEvent>
     
    protected int
    getSlopeFindDistance(net.minecraft.world.level.LevelReader worldIn)
     
    net.minecraft.world.level.material.Fluid
     
    int
    getTickDelay(net.minecraft.world.level.LevelReader level)
     
    boolean
    isSame(net.minecraft.world.level.material.Fluid fluidIn)
     

    Methods inherited from class net.minecraft.world.level.material.FlowingFluid

    createFluidStateDefinition, getAmount, getFlow, getFlowing, getHeight, getLegacyLevel, getNewLiquid, getOwnHeight, getShape, getSlopeDistance, getSource, getSpread, getSpreadDelay, isSolidFace, spread, spreadTo, tick

    Methods inherited from class net.minecraft.world.level.material.Fluid

    animateTick, builtInRegistryHolder, defaultFluidState, entityInside, getAABB, getDripParticle, getStateDefinition, is, isEmpty, isRandomlyTicking, isSource, randomTick, registerDefaultState, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IFluidExtension

    canExtinguish, canHydrate, getAdjacentBlockPathType, getBlockPathType, getExplosionResistance, move, supportsBoating
  • Field Details

    • fluidType

      private final Supplier<? extends FluidType> fluidType
    • flowing

      private final Supplier<? extends net.minecraft.world.level.material.Fluid> flowing
    • still

      private final Supplier<? extends net.minecraft.world.level.material.Fluid> still
    • bucket

      @Nullable private final @Nullable Supplier<? extends net.minecraft.world.item.Item> bucket
    • block

      @Nullable private final @Nullable Supplier<? extends net.minecraft.world.level.block.LiquidBlock> block
    • slopeFindDistance

      private final int slopeFindDistance
    • levelDecreasePerBlock

      private final int levelDecreasePerBlock
    • explosionResistance

      private final float explosionResistance
    • tickRate

      private final int tickRate
  • Constructor Details

  • Method Details

    • getFluidType

      public FluidType getFluidType()
      Description copied from interface: IFluidExtension
      Returns the type of this fluid.

      Important: This MUST be overridden on your fluid, otherwise an error will be thrown.

      Specified by:
      getFluidType in interface IFluidExtension
      Overrides:
      getFluidType in class net.minecraft.world.level.material.Fluid
      Returns:
      the type of this fluid
    • getFlowing

      public net.minecraft.world.level.material.Fluid getFlowing()
      Specified by:
      getFlowing in class net.minecraft.world.level.material.FlowingFluid
    • getSource

      public net.minecraft.world.level.material.Fluid getSource()
      Specified by:
      getSource in class net.minecraft.world.level.material.FlowingFluid
    • canConvertToSource

      protected boolean canConvertToSource(net.minecraft.server.level.ServerLevel level)
      Specified by:
      canConvertToSource in class net.minecraft.world.level.material.FlowingFluid
    • canConvertToSource

      public boolean canConvertToSource(net.minecraft.world.level.material.FluidState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos)
      Description copied from interface: IFluidExtension
      Returns whether the fluid can create a source.
      Specified by:
      canConvertToSource in interface IFluidExtension
      Overrides:
      canConvertToSource in class net.minecraft.world.level.material.FlowingFluid
      Parameters:
      state - the state of the fluid
      level - the level that can get the fluid
      pos - the location of the fluid
      Returns:
      true if the fluid can create a source, false otherwise
    • beforeDestroyingBlock

      protected void beforeDestroyingBlock(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Specified by:
      beforeDestroyingBlock in class net.minecraft.world.level.material.FlowingFluid
    • getSlopeFindDistance

      protected int getSlopeFindDistance(net.minecraft.world.level.LevelReader worldIn)
      Specified by:
      getSlopeFindDistance in class net.minecraft.world.level.material.FlowingFluid
    • getDropOff

      protected int getDropOff(net.minecraft.world.level.LevelReader worldIn)
      Specified by:
      getDropOff in class net.minecraft.world.level.material.FlowingFluid
    • getBucket

      public net.minecraft.world.item.Item getBucket()
      Specified by:
      getBucket in class net.minecraft.world.level.material.Fluid
    • canBeReplacedWith

      protected boolean canBeReplacedWith(net.minecraft.world.level.material.FluidState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.Fluid fluidIn, net.minecraft.core.Direction direction)
      Specified by:
      canBeReplacedWith in class net.minecraft.world.level.material.Fluid
    • getTickDelay

      public int getTickDelay(net.minecraft.world.level.LevelReader level)
      Specified by:
      getTickDelay in class net.minecraft.world.level.material.Fluid
    • getExplosionResistance

      protected float getExplosionResistance()
      Specified by:
      getExplosionResistance in class net.minecraft.world.level.material.Fluid
    • createLegacyBlock

      protected net.minecraft.world.level.block.state.BlockState createLegacyBlock(net.minecraft.world.level.material.FluidState state)
      Specified by:
      createLegacyBlock in class net.minecraft.world.level.material.Fluid
    • isSame

      public boolean isSame(net.minecraft.world.level.material.Fluid fluidIn)
      Overrides:
      isSame in class net.minecraft.world.level.material.Fluid
    • getPickupSound

      public Optional<net.minecraft.sounds.SoundEvent> getPickupSound()
      Overrides:
      getPickupSound in class net.minecraft.world.level.material.Fluid