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 record
protected class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
static final BooleanProperty
static final IntegerProperty
private 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 boolean
affectsFlow
(FluidState p_76095_) protected abstract void
beforeDestroyingBlock
(LevelAccessor p_76002_, BlockPos p_76003_, BlockState p_76004_) protected abstract boolean
canConvertToSource
(ServerLevel p_376940_) Deprecated.boolean
canConvertToSource
(FluidState state, ServerLevel level, BlockPos pos) Returns whether the fluid can create a source.private static boolean
canHoldAnyFluid
(BlockState p_362073_) private static boolean
canHoldFluid
(BlockGetter p_75973_, BlockPos p_75974_, BlockState p_75975_, Fluid p_75976_) private static boolean
canHoldSpecificFluid
(BlockGetter p_361904_, BlockPos p_360557_, BlockState p_365254_, Fluid p_365308_) private boolean
canMaybePassThrough
(BlockGetter p_361039_, BlockPos p_364099_, BlockState p_363055_, Direction p_361101_, BlockPos p_362307_, BlockState p_363139_, FluidState p_362538_) private boolean
canPassThrough
(BlockGetter p_75964_, Fluid p_75965_, BlockPos p_75966_, BlockState p_75967_, Direction p_75968_, BlockPos p_75969_, BlockState p_75970_, FluidState p_75971_) private static boolean
canPassThroughWall
(Direction p_76062_, BlockGetter p_76063_, BlockPos p_76064_, BlockState p_76065_, BlockPos p_76066_, BlockState p_76067_) protected void
abstract int
getAmount
(FluidState p_164509_) protected abstract int
getDropOff
(LevelReader p_76087_) getFlow
(BlockGetter p_75987_, BlockPos p_75988_, FluidState p_75989_) abstract Fluid
getFlowing
(int p_75954_, boolean p_75955_) float
getHeight
(FluidState p_76050_, BlockGetter p_76051_, BlockPos p_76052_) protected static int
getLegacyLevel
(FluidState p_76093_) protected FluidState
getNewLiquid
(ServerLevel p_376839_, BlockPos p_76037_, BlockState p_76038_) float
getOwnHeight
(FluidState p_76048_) getShape
(FluidState p_76084_, BlockGetter p_76085_, BlockPos p_76086_) protected int
getSlopeDistance
(LevelReader p_76027_, BlockPos p_76028_, int p_76029_, Direction p_76030_, BlockState p_76031_, FlowingFluid.SpreadContext p_364491_) protected abstract int
getSlopeFindDistance
(LevelReader p_76074_) abstract Fluid
getSource
(boolean p_76069_) protected Map
<Direction, FluidState> getSpread
(ServerLevel p_376283_, BlockPos p_76081_, BlockState p_76082_) protected int
getSpreadDelay
(Level p_75998_, BlockPos p_75999_, FluidState p_76000_, FluidState p_76001_) private static boolean
hasSameAbove
(FluidState p_76089_, BlockGetter p_76090_, BlockPos p_76091_) protected boolean
isSolidFace
(BlockGetter p_75991_, BlockPos p_75992_, Direction p_75993_) private boolean
isSourceBlockOfThisType
(FluidState p_76097_) (package private) boolean
isWaterHole
(BlockGetter p_75957_, BlockPos p_75959_, BlockState p_75960_, BlockPos p_75961_, BlockState p_75962_) private int
sourceNeighborCount
(LevelReader p_76020_, BlockPos p_76021_) protected void
spread
(ServerLevel p_376507_, BlockPos p_76012_, BlockState p_361407_, FluidState p_76013_) protected void
spreadTo
(LevelAccessor p_76005_, BlockPos p_76006_, BlockState p_76007_, Direction p_76008_, FluidState p_76009_) private void
spreadToSides
(ServerLevel p_376224_, BlockPos p_76016_, FluidState p_76017_, BlockState p_76018_) void
tick
(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, 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
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:
createFluidStateDefinition
in classFluid
-
getFlow
-
affectsFlow
-
isSolidFace
-
spread
protected void spread(ServerLevel p_376507_, BlockPos p_76012_, BlockState p_361407_, FluidState p_76013_) -
spreadToSides
private void spreadToSides(ServerLevel p_376224_, BlockPos p_76016_, FluidState p_76017_, BlockState p_76018_) -
getNewLiquid
-
canPassThroughWall
private static boolean canPassThroughWall(Direction p_76062_, BlockGetter p_76063_, BlockPos p_76064_, BlockState p_76065_, BlockPos p_76066_, BlockState p_76067_) -
getFlowing
-
getFlowing
-
getSource
-
getSource
-
canConvertToSource
Description copied from interface:IFluidExtension
Returns 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:
true
if the fluid can create a source,false
otherwise
-
canConvertToSource
Deprecated.Forge: UsecanConvertToSource(FluidState, ServerLevel, BlockPos)
instead. -
spreadTo
protected void spreadTo(LevelAccessor p_76005_, BlockPos p_76006_, BlockState p_76007_, Direction p_76008_, FluidState p_76009_) -
beforeDestroyingBlock
protected abstract void beforeDestroyingBlock(LevelAccessor p_76002_, BlockPos p_76003_, BlockState p_76004_) -
getSlopeDistance
protected int getSlopeDistance(LevelReader p_76027_, BlockPos p_76028_, int p_76029_, Direction p_76030_, BlockState p_76031_, FlowingFluid.SpreadContext p_364491_) -
isWaterHole
boolean isWaterHole(BlockGetter p_75957_, BlockPos p_75959_, BlockState p_75960_, BlockPos p_75961_, BlockState p_75962_) -
canPassThrough
private boolean canPassThrough(BlockGetter p_75964_, Fluid p_75965_, BlockPos p_75966_, BlockState p_75967_, Direction p_75968_, BlockPos p_75969_, BlockState p_75970_, FluidState p_75971_) -
canMaybePassThrough
private boolean canMaybePassThrough(BlockGetter p_361039_, BlockPos p_364099_, BlockState p_363055_, Direction p_361101_, BlockPos p_362307_, BlockState p_363139_, FluidState p_362538_) -
isSourceBlockOfThisType
-
getSlopeFindDistance
-
sourceNeighborCount
-
getSpread
protected Map<Direction,FluidState> getSpread(ServerLevel p_376283_, BlockPos p_76081_, BlockState p_76082_) -
canHoldAnyFluid
-
canHoldFluid
private static boolean canHoldFluid(BlockGetter p_75973_, BlockPos p_75974_, BlockState p_75975_, Fluid p_75976_) -
canHoldSpecificFluid
private static boolean canHoldSpecificFluid(BlockGetter p_361904_, BlockPos p_360557_, BlockState p_365254_, Fluid p_365308_) -
getDropOff
-
getSpreadDelay
protected int getSpreadDelay(Level p_75998_, BlockPos p_75999_, FluidState p_76000_, FluidState p_76001_) -
tick
public void tick(ServerLevel p_376710_, BlockPos p_75996_, BlockState p_360412_, FluidState p_75997_) -
getLegacyLevel
-
hasSameAbove
-
getHeight
-
getOwnHeight
- Specified by:
getOwnHeight
in classFluid
-
getAmount
-
getShape
-
canConvertToSource(FluidState, ServerLevel, BlockPos)
instead.