Class FluidState
java.lang.Object
net.minecraft.world.level.block.state.StateHolder<Fluid, FluidState>
net.minecraft.world.level.material.FluidState
- All Implemented Interfaces:
TypedInstance<Fluid>, IFluidStateExtension
public final class FluidState
extends StateHolder<Fluid, FluidState>
implements TypedInstance<Fluid>, IFluidStateExtension
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final com.mojang.serialization.Codec<FluidState> Fields inherited from class StateHolder
NAME_TAG, owner, PROPERTIES_TAG, propertiesCodec -
Constructor Summary
ConstructorsConstructorDescriptionFluidState(Fluid owner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> values, com.mojang.serialization.MapCodec<FluidState> propertiesCodec) -
Method Summary
Modifier and TypeMethodDescriptionvoidanimateTick(Level level, BlockPos pos, RandomSource random) booleancanBeReplacedWith(BlockGetter level, BlockPos pos, Fluid other, Direction direction) voidentityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) @Nullable AABBgetAABB(BlockGetter level, BlockPos pos) int@Nullable ParticleOptionsfloatDeprecated.getFlow(BlockGetter level, BlockPos pos) floatgetHeight(BlockGetter level, BlockPos pos) floatgetShape(BlockGetter level, BlockPos pos) getType()booleanisEmpty()booleanisFull()booleanbooleanisSource()booleanisSourceOfType(Fluid fluidType) voidrandomTick(ServerLevel level, BlockPos pos, RandomSource random) booleanshouldRenderBackwardUpFace(BlockGetter level, BlockPos above) voidtick(ServerLevel level, BlockPos pos, BlockState blockState) Methods inherited from class StateHolder
codec, cycle, equals, findNextInCollection, getOptionalValue, getProperties, getValue, getValueOrElse, getValues, hashCode, hasProperty, populateNeighbours, setValue, toString, trySetValueMethods inherited from interface IFluidStateExtension
canConvertToSource, canExtinguish, canHydrate, getAdjacentBlockPathType, getBlockPathType, getExplosionResistance, getFluidType, move, supportsBoating
-
Field Details
-
CODEC
-
AMOUNT_MAX
public static final int AMOUNT_MAX- See Also:
-
AMOUNT_FULL
public static final int AMOUNT_FULL- See Also:
-
-
Constructor Details
-
FluidState
public FluidState(Fluid owner, it.unimi.dsi.fastutil.objects.Reference2ObjectArrayMap<Property<?>, Comparable<?>> values, com.mojang.serialization.MapCodec<FluidState> propertiesCodec)
-
-
Method Details
-
getType
-
isSource
public boolean isSource() -
isSourceOfType
-
isEmpty
public boolean isEmpty() -
getHeight
-
getOwnHeight
public float getOwnHeight() -
isFull
public boolean isFull() -
getAmount
public int getAmount() -
shouldRenderBackwardUpFace
-
tick
-
animateTick
-
isRandomlyTicking
public boolean isRandomlyTicking() -
randomTick
-
getFlow
-
createLegacyBlock
-
getDripParticle
-
typeHolder
- Specified by:
typeHolderin interfaceTypedInstance<Fluid>
-
getExplosionResistance
Deprecated. -
canBeReplacedWith
-
getShape
-
getAABB
-
entityInside
public void entityInside(Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier)
-