Class FlowingFluid
java.lang.Object
net.minecraft.world.level.material.Fluid
net.minecraft.world.level.material.FlowingFluid
- All Implemented Interfaces:
IFluidExtension
- Direct Known Subclasses:
BaseFlowingFluid,LavaFluid,WaterFluid
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intstatic final BooleanPropertystatic final IntegerPropertyprivate static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<FlowingFluid.BlockStatePairKey>> private final Map<FluidState, VoxelShape> Fields inherited from class net.minecraft.world.level.material.Fluid
FLUID_STATE_REGISTRY, stateDefinition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanaffectsFlow(FluidState state) protected abstract voidbeforeDestroyingBlock(LevelAccessor level, BlockPos pos, BlockState state) protected abstract booleancanConvertToSource(ServerLevel level) Deprecated.booleancanConvertToSource(FluidState state, ServerLevel level, BlockPos pos) Returns whether the fluid can create a source.private static booleancanHoldAnyFluid(BlockState state) private static booleancanHoldFluid(BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) private static booleancanHoldSpecificFluid(BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) private booleancanMaybePassThrough(BlockGetter level, BlockPos pos, BlockState state, Direction direction, BlockPos spreadPos, BlockState spreadState, FluidState fluidState) private booleancanPassThrough(BlockGetter level, Fluid fluid, BlockPos pos, BlockState state, Direction direction, BlockPos spreadPos, BlockState spreadState, FluidState fluidState) private static booleancanPassThroughWall(Direction direction, BlockGetter level, BlockPos pos, BlockState state, BlockPos spreadPos, BlockState spreadState) protected voidabstract intgetAmount(FluidState p_164509_) protected abstract intgetDropOff(LevelReader level) getFlow(BlockGetter blockReader, BlockPos pos, FluidState fluidState) abstract FluidgetFlowing(int level, boolean falling) floatgetHeight(FluidState p_76050_, BlockGetter p_76051_, BlockPos p_76052_) protected static intgetLegacyLevel(FluidState state) protected FluidStategetNewLiquid(ServerLevel level, BlockPos pos, BlockState state) floatgetOwnHeight(FluidState p_76048_) getShape(FluidState p_76084_, BlockGetter p_76085_, BlockPos p_76086_) protected intgetSlopeDistance(LevelReader level, BlockPos pos, int depth, Direction direction, BlockState state, FlowingFluid.SpreadContext spreadContext) protected abstract intgetSlopeFindDistance(LevelReader level) abstract FluidgetSource(boolean falling) protected Map<Direction, FluidState> getSpread(ServerLevel level, BlockPos pos, BlockState state) protected intgetSpreadDelay(Level level, BlockPos pos, FluidState currentState, FluidState newState) private static booleanhasSameAbove(FluidState fluidState, BlockGetter level, BlockPos pos) protected booleanisSolidFace(BlockGetter level, BlockPos neighborPos, Direction side) private boolean(package private) booleanisWaterHole(BlockGetter level, BlockPos pos, BlockState state, BlockPos belowPos, BlockState belowState) private intsourceNeighborCount(LevelReader level, BlockPos pos) Returns the number of immediately adjacent source blocks of the same fluid that lie on the horizontal plane.protected voidspread(ServerLevel level, BlockPos pos, BlockState blockState, FluidState fluidState) protected voidspreadTo(LevelAccessor level, BlockPos pos, BlockState blockState, Direction direction, FluidState fluidState) private voidspreadToSides(ServerLevel level, BlockPos pos, FluidState fluidState, BlockState blockState) voidtick(ServerLevel p_376710_, BlockPos p_75996_, BlockState p_360412_, FluidState p_75997_) Methods inherited from class net.minecraft.world.level.material.Fluid
animateTick, builtInRegistryHolder, canBeReplacedWith, createLegacyBlock, defaultFluidState, entityInside, getAABB, getBucket, getDripParticle, getExplosionResistance, getFluidType, getPickupSound, getStateDefinition, getTickDelay, is, isEmpty, isRandomlyTicking, isSame, isSource, randomTick, registerDefaultState, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.IFluidExtension
canExtinguish, canHydrate, getAdjacentBlockPathType, getBlockPathType, getExplosionResistance, move, supportsBoating
-
Field Details
-
FALLING
-
LEVEL
-
CACHE_SIZE
private static final int CACHE_SIZE- See Also:
-
OCCLUSION_CACHE
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<FlowingFluid.BlockStatePairKey>> OCCLUSION_CACHE -
shapes
-
-
Constructor Details
-
FlowingFluid
public FlowingFluid()
-
-
Method Details
-
createFluidStateDefinition
- Overrides:
createFluidStateDefinitionin classFluid
-
getFlow
-
affectsFlow
-
isSolidFace
-
spread
protected void spread(ServerLevel level, BlockPos pos, BlockState blockState, FluidState fluidState) -
spreadToSides
private void spreadToSides(ServerLevel level, BlockPos pos, FluidState fluidState, BlockState blockState) -
getNewLiquid
-
canPassThroughWall
private static boolean canPassThroughWall(Direction direction, BlockGetter level, BlockPos pos, BlockState state, BlockPos spreadPos, BlockState spreadState) -
getFlowing
-
getFlowing
-
getSource
-
getSource
-
canConvertToSource
Description copied from interface:IFluidExtensionReturns whether the fluid can create a source.- Parameters:
state- the state of the fluidlevel- the level that can get the fluidpos- the location of the fluid- Returns:
trueif the fluid can create a source,falseotherwise
-
canConvertToSource
Deprecated.Forge: UsecanConvertToSource(FluidState, ServerLevel, BlockPos)instead. -
spreadTo
protected void spreadTo(LevelAccessor level, BlockPos pos, BlockState blockState, Direction direction, FluidState fluidState) -
beforeDestroyingBlock
-
getSlopeDistance
protected int getSlopeDistance(LevelReader level, BlockPos pos, int depth, Direction direction, BlockState state, FlowingFluid.SpreadContext spreadContext) -
isWaterHole
boolean isWaterHole(BlockGetter level, BlockPos pos, BlockState state, BlockPos belowPos, BlockState belowState) -
canPassThrough
private boolean canPassThrough(BlockGetter level, Fluid fluid, BlockPos pos, BlockState state, Direction direction, BlockPos spreadPos, BlockState spreadState, FluidState fluidState) -
canMaybePassThrough
private boolean canMaybePassThrough(BlockGetter level, BlockPos pos, BlockState state, Direction direction, BlockPos spreadPos, BlockState spreadState, FluidState fluidState) -
isSourceBlockOfThisType
-
getSlopeFindDistance
-
sourceNeighborCount
Returns the number of immediately adjacent source blocks of the same fluid that lie on the horizontal plane. -
getSpread
-
canHoldAnyFluid
-
canHoldFluid
-
canHoldSpecificFluid
private static boolean canHoldSpecificFluid(BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) -
getDropOff
-
getSpreadDelay
protected int getSpreadDelay(Level level, BlockPos pos, FluidState currentState, FluidState newState) -
tick
public void tick(ServerLevel p_376710_, BlockPos p_75996_, BlockState p_360412_, FluidState p_75997_) -
getLegacyLevel
-
hasSameAbove
-
getHeight
-
getOwnHeight
- Specified by:
getOwnHeightin classFluid
-
getAmount
-
getShape
-
canConvertToSource(FluidState, ServerLevel, BlockPos)instead.