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 FluidStateprivate @Nullable FluidResourcestatic final IdMapper<FluidState> private FluidTypeprotected final StateDefinition<Fluid, FluidState> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidanimateTick(Level level, BlockPos pos, FluidState fluidState, RandomSource random) Deprecated.protected abstract booleancanBeReplacedWith(FluidState state, BlockGetter level, BlockPos pos, Fluid other, Direction direction) computeDefaultResource(Function<Fluid, FluidResource> resourceConstructor) Deprecated.protected voidprotected abstract BlockStatecreateLegacyBlock(FluidState fluidState) final FluidStateprotected voidentityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) @Nullable AABBgetAABB(FluidState state, BlockGetter level, BlockPos pos) abstract intgetAmount(FluidState fluidState) abstract Itemprotected @Nullable ParticleOptionsprotected abstract floatprotected abstract Vec3getFlow(BlockGetter level, BlockPos pos, FluidState fluidState) Returns the type of this fluid.abstract floatgetHeight(FluidState fluidState, BlockGetter level, BlockPos pos) abstract floatgetOwnHeight(FluidState fluidState) abstract VoxelShapegetShape(FluidState state, BlockGetter level, BlockPos pos) abstract intgetTickDelay(LevelReader level) booleanDeprecated.protected booleanisEmpty()protected booleanbooleanabstract booleanisSource(FluidState fluidState) protected voidrandomTick(ServerLevel level, BlockPos pos, FluidState fluidState, RandomSource random) protected final voidregisterDefaultState(FluidState state) protected voidtick(ServerLevel level, BlockPos pos, BlockState blockState, FluidState fluidState) toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IFluidExtension
appendHoverText, canConvertToSource, canExtinguish, canHydrate, getAdjacentBlockPathType, getBlockPathType, getExplosionResistance, move, supportsBoating
-
Field Details
-
FLUID_STATE_REGISTRY
-
stateDefinition
-
defaultFluidState
-
builtInRegistryHolder
-
defaultResource
-
forgeFluidType
-
-
Constructor Details
-
Fluid
protected Fluid()
-
-
Method Details
-
createFluidStateDefinition
-
getStateDefinition
-
registerDefaultState
-
defaultFluidState
-
getBucket
-
animateTick
-
tick
-
randomTick
protected void randomTick(ServerLevel level, BlockPos pos, FluidState fluidState, RandomSource random) -
entityInside
protected void entityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) -
getDripParticle
-
canBeReplacedWith
protected abstract boolean canBeReplacedWith(FluidState state, BlockGetter level, BlockPos pos, Fluid other, 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
-
getAABB
-
getPickupSound
-
builtInRegistryHolder
Deprecated. -
getFluidType
Description copied from interface:IFluidExtensionReturns the type of this fluid.Important: This MUST be overridden on your fluid, otherwise an error will be thrown.
- Specified by:
getFluidTypein interfaceIFluidExtension- Returns:
- the type of this fluid
-
computeDefaultResource
@Internal @Deprecated public FluidResource computeDefaultResource(Function<Fluid, FluidResource> resourceConstructor) Deprecated.Neo: do not use, useFluidResource.of(FluidStack)instead.
-
FluidResource.of(FluidStack)instead.