Class Fluid
java.lang.Object
net.minecraft.world.level.material.Fluid
- All Implemented Interfaces:
IFluidExtension
- Direct Known Subclasses:
EmptyFluid
,FlowingFluid
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder.Reference
<Fluid> private FluidState
static final IdMapper
<FluidState> private FluidType
protected final StateDefinition
<Fluid, FluidState> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
animateTick
(Level level, BlockPos pos, FluidState state, RandomSource random) Deprecated.protected abstract boolean
canBeReplacedWith
(FluidState state, BlockGetter level, BlockPos pos, Fluid fluid, Direction direction) protected void
protected abstract BlockState
createLegacyBlock
(FluidState state) final FluidState
abstract int
getAmount
(FluidState state) abstract Item
protected ParticleOptions
protected abstract float
protected abstract Vec3
getFlow
(BlockGetter blockReader, BlockPos pos, FluidState fluidState) Returns the type of this fluid.abstract float
getHeight
(FluidState state, BlockGetter level, BlockPos pos) abstract float
getOwnHeight
(FluidState state) abstract VoxelShape
getShape
(FluidState state, BlockGetter level, BlockPos pos) abstract int
getTickDelay
(LevelReader level) boolean
Deprecated.protected boolean
isEmpty()
protected boolean
boolean
abstract boolean
isSource
(FluidState state) protected void
randomTick
(Level level, BlockPos pos, FluidState state, RandomSource random) protected final void
registerDefaultState
(FluidState state) protected void
tick
(Level level, BlockPos pos, FluidState state) 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
canConvertToSource, canExtinguish, canHydrate, getAdjacentBlockPathType, getBlockPathType, getExplosionResistance, move, supportsBoating
-
Field Details
-
FLUID_STATE_REGISTRY
-
stateDefinition
-
defaultFluidState
-
builtInRegistryHolder
-
forgeFluidType
-
-
Constructor Details
-
Fluid
protected Fluid()
-
-
Method Details
-
createFluidStateDefinition
-
getStateDefinition
-
registerDefaultState
-
defaultFluidState
-
getBucket
-
animateTick
-
tick
-
randomTick
-
getDripParticle
-
canBeReplacedWith
protected abstract boolean canBeReplacedWith(FluidState state, BlockGetter level, BlockPos pos, Fluid fluid, Direction direction) -
getFlow
-
getTickDelay
-
isRandomlyTicking
protected boolean isRandomlyTicking() -
isEmpty
protected boolean isEmpty() -
getExplosionResistance
protected abstract float getExplosionResistance() -
getHeight
-
getOwnHeight
-
createLegacyBlock
-
isSource
-
getAmount
-
isSame
-
is
Deprecated. -
getShape
-
toString
-
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 interfaceIFluidExtension
- Returns:
- the type of this fluid
-
getPickupSound
-
builtInRegistryHolder
Deprecated.
-