Class FlowingFluid
java.lang.Object
net.minecraft.world.level.material.Fluid
net.minecraft.world.level.material.FlowingFluid
- All Implemented Interfaces:
IForgeFluid
- Direct Known Subclasses:
ForgeFlowingFluid
,LavaFluid
,WaterFluid
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
static final BooleanProperty
static final IntegerProperty
private static final ThreadLocal<it.unimi.dsi.fastutil.objects.Object2ByteLinkedOpenHashMap<Block.BlockStatePairKey>>
private final Map<FluidState,
VoxelShape> Fields inherited from class net.minecraft.world.level.material.Fluid
FLUID_STATE_REGISTRY, stateDefinition
-
Constructor Summary
-
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
(Level p_256009_) Deprecated.boolean
canConvertToSource
(FluidState state, Level level, BlockPos pos) Returns whether the fluid can create a source.private boolean
canHoldFluid
(BlockGetter p_75973_, BlockPos p_75974_, BlockState p_75975_, Fluid p_75976_) 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 boolean
canPassThroughWall
(Direction p_76062_, BlockGetter p_76063_, BlockPos p_76064_, BlockState p_76065_, BlockPos p_76066_, BlockState p_76067_) protected boolean
canSpreadTo
(BlockGetter p_75978_, BlockPos p_75979_, BlockState p_75980_, Direction p_75981_, BlockPos p_75982_, BlockState p_75983_, FluidState p_75984_, Fluid p_75985_) protected void
abstract int
getAmount
(FluidState p_164509_) private static short
getCacheKey
(BlockPos p_76059_, BlockPos p_76060_) 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
(Level p_256464_, 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_, BlockPos p_76032_, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<com.mojang.datafixers.util.Pair<BlockState, FluidState>> p_76033_, it.unimi.dsi.fastutil.shorts.Short2BooleanMap p_76034_) protected abstract int
getSlopeFindDistance
(LevelReader p_76074_) abstract Fluid
getSource
(boolean p_76069_) protected Map<Direction,
FluidState> getSpread
(Level p_256191_, 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_) private boolean
isWaterHole
(BlockGetter p_75957_, Fluid p_75958_, BlockPos p_75959_, BlockState p_75960_, BlockPos p_75961_, BlockState p_75962_) private int
sourceNeighborCount
(LevelReader p_76020_, BlockPos p_76021_) protected void
spread
(Level p_255851_, BlockPos p_76012_, FluidState p_76013_) protected void
spreadTo
(LevelAccessor p_76005_, BlockPos p_76006_, BlockState p_76007_, Direction p_76008_, FluidState p_76009_) private void
spreadToSides
(Level p_256644_, BlockPos p_76016_, FluidState p_76017_, BlockState p_76018_) void
tick
(Level p_75995_, BlockPos p_75996_, FluidState p_75997_) Methods inherited from class net.minecraft.world.level.material.Fluid
animateTick, builtInRegistryHolder, canBeReplacedWith, createLegacyBlock, defaultFluidState, getBucket, getDripParticle, getExplosionResistance, getFluidType, getPickupSound, getStateDefinition, getTickDelay, is, isEmpty, isRandomlyTicking, isSame, isSource, randomTick, registerDefaultState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeFluid
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<Block.BlockStatePairKey>> OCCLUSION_CACHE -
shapes
-
-
Constructor Details
-
FlowingFluid
public FlowingFluid()
-
-
Method Details
-
createFluidStateDefinition
- Overrides:
createFluidStateDefinition
in classFluid
-
getFlow
-
affectsFlow
-
isSolidFace
-
spread
-
spreadToSides
private void spreadToSides(Level p_256644_, BlockPos p_76016_, FluidState p_76017_, BlockState p_76018_) -
getNewLiquid
-
canPassThroughWall
private 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:IForgeFluid
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, Level, 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_) -
getCacheKey
-
getSlopeDistance
protected int getSlopeDistance(LevelReader p_76027_, BlockPos p_76028_, int p_76029_, Direction p_76030_, BlockState p_76031_, BlockPos p_76032_, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<com.mojang.datafixers.util.Pair<BlockState, FluidState>> p_76033_, it.unimi.dsi.fastutil.shorts.Short2BooleanMap p_76034_) -
isWaterHole
private boolean isWaterHole(BlockGetter p_75957_, Fluid p_75958_, 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_) -
isSourceBlockOfThisType
-
getSlopeFindDistance
-
sourceNeighborCount
-
getSpread
protected Map<Direction,FluidState> getSpread(Level p_256191_, BlockPos p_76081_, BlockState p_76082_) -
canHoldFluid
private boolean canHoldFluid(BlockGetter p_75973_, BlockPos p_75974_, BlockState p_75975_, Fluid p_75976_) -
canSpreadTo
protected boolean canSpreadTo(BlockGetter p_75978_, BlockPos p_75979_, BlockState p_75980_, Direction p_75981_, BlockPos p_75982_, BlockState p_75983_, FluidState p_75984_, Fluid p_75985_) -
getDropOff
-
getSpreadDelay
protected int getSpreadDelay(Level p_75998_, BlockPos p_75999_, FluidState p_76000_, FluidState p_76001_) -
tick
-
getLegacyLevel
-
hasSameAbove
-
getHeight
-
getOwnHeight
- Specified by:
getOwnHeight
in classFluid
-
getAmount
-
getShape
-
canConvertToSource(FluidState, Level, BlockPos)
instead.