Class Fluid

All Implemented Interfaces:
IForgeFluid, IForgeRegistryEntry<Fluid>
Direct Known Subclasses:
EmptyFluid, FlowingFluid

public abstract class Fluid extends ForgeRegistryEntry<Fluid> implements IForgeFluid
  • Field Details

  • Constructor Details

    • Fluid

      protected Fluid()
  • Method Details

    • createFluidStateDefinition

      protected void createFluidStateDefinition(StateDefinition.Builder<Fluid,​FluidState> p_76121_)
    • getStateDefinition

      public StateDefinition<Fluid,​FluidState> getStateDefinition()
    • registerDefaultState

      protected final void registerDefaultState(FluidState p_76143_)
    • defaultFluidState

      public final FluidState defaultFluidState()
    • getBucket

      public abstract Item getBucket()
    • animateTick

      protected void animateTick(Level p_76116_, BlockPos p_76117_, FluidState p_76118_, Random p_76119_)
    • tick

      protected void tick(Level p_76113_, BlockPos p_76114_, FluidState p_76115_)
    • randomTick

      protected void randomTick(Level p_76132_, BlockPos p_76133_, FluidState p_76134_, Random p_76135_)
    • getDripParticle

      @Nullable protected ParticleOptions getDripParticle()
    • canBeReplacedWith

      protected abstract boolean canBeReplacedWith(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_)
    • getFlow

      protected abstract Vec3 getFlow(BlockGetter p_76110_, BlockPos p_76111_, FluidState p_76112_)
    • getTickDelay

      public abstract int getTickDelay(LevelReader p_76120_)
    • isRandomlyTicking

      protected boolean isRandomlyTicking()
    • isEmpty

      protected boolean isEmpty()
    • getExplosionResistance

      protected abstract float getExplosionResistance()
    • getHeight

      public abstract float getHeight(FluidState p_76124_, BlockGetter p_76125_, BlockPos p_76126_)
    • getOwnHeight

      public abstract float getOwnHeight(FluidState p_76123_)
    • createLegacyBlock

      protected abstract BlockState createLegacyBlock(FluidState p_76136_)
    • isSource

      public abstract boolean isSource(FluidState p_76140_)
    • getAmount

      public abstract int getAmount(FluidState p_76141_)
    • isSame

      public boolean isSame(Fluid p_76122_)
    • is

      public boolean is(Tag<Fluid> p_76109_)
    • getShape

      public abstract VoxelShape getShape(FluidState p_76137_, BlockGetter p_76138_, BlockPos p_76139_)
    • getTags

      public Set<ResourceLocation> getTags()
      Description copied from interface: IForgeFluid
      Retrieves a list of tags names this is known to be associated with. This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes.
      Specified by:
      getTags in interface IForgeFluid
    • createAttributes

      protected FluidAttributes createAttributes()
      Creates the fluid attributes object, which will contain all the extended values for the fluid that aren't part of the vanilla system. Do not call this from outside. To retrieve the values use getAttributes()
    • getAttributes

      public final FluidAttributes getAttributes()
      Description copied from interface: IForgeFluid
      Retrieves the non-vanilla fluid attributes, including localized name.
      Specified by:
      getAttributes in interface IForgeFluid
    • getPickupSound

      public Optional<SoundEvent> getPickupSound()