Class Fluid
java.lang.Object
net.minecraft.world.level.material.Fluid
- All Implemented Interfaces:
IFluidExtension
- Direct Known Subclasses:
EmptyFluid
,FlowingFluid
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Holder.Reference
<Fluid> private FluidState
static final IdMapper
<FluidState> private FluidType
protected final StateDefinition
<Fluid, FluidState> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
animateTick
(Level p_230550_, BlockPos p_230551_, FluidState p_230552_, RandomSource p_230553_) Deprecated.protected abstract boolean
canBeReplacedWith
(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_) protected void
protected abstract BlockState
createLegacyBlock
(FluidState p_76136_) final FluidState
abstract int
getAmount
(FluidState p_76141_) abstract Item
protected ParticleOptions
protected abstract float
protected abstract Vec3
getFlow
(BlockGetter p_76110_, BlockPos p_76111_, FluidState p_76112_) Returns the type of this fluid.abstract float
getHeight
(FluidState p_76124_, BlockGetter p_76125_, BlockPos p_76126_) abstract float
getOwnHeight
(FluidState p_76123_) abstract VoxelShape
getShape
(FluidState p_76137_, BlockGetter p_76138_, BlockPos p_76139_) abstract int
getTickDelay
(LevelReader p_76120_) boolean
Deprecated.protected boolean
isEmpty()
protected boolean
boolean
abstract boolean
isSource
(FluidState p_76140_) protected void
randomTick
(Level p_230554_, BlockPos p_230555_, FluidState p_230556_, RandomSource p_230557_) protected final void
registerDefaultState
(FluidState p_76143_) protected void
tick
(Level p_76113_, BlockPos p_76114_, FluidState p_76115_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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
protected void animateTick(Level p_230550_, BlockPos p_230551_, FluidState p_230552_, RandomSource p_230553_) -
tick
-
randomTick
protected void randomTick(Level p_230554_, BlockPos p_230555_, FluidState p_230556_, RandomSource p_230557_) -
getDripParticle
-
canBeReplacedWith
protected abstract boolean canBeReplacedWith(FluidState p_76127_, BlockGetter p_76128_, BlockPos p_76129_, Fluid p_76130_, Direction p_76131_) -
getFlow
-
getTickDelay
-
isRandomlyTicking
protected boolean isRandomlyTicking() -
isEmpty
protected boolean isEmpty() -
getExplosionResistance
protected abstract float getExplosionResistance() -
getHeight
-
getOwnHeight
-
createLegacyBlock
-
isSource
-
getAmount
-
isSame
-
is
Deprecated. -
getShape
-
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.
-