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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intstatic final BooleanPropertystatic final IntegerPropertyprivate 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanaffectsFlow(FluidState state) protected abstract voidbeforeDestroyingBlock(LevelAccessor level, BlockPos pos, BlockState state) protected abstract booleancanConvertToSource(Level level) Deprecated.booleancanConvertToSource(FluidState state, Level level, BlockPos pos) Returns whether the fluid can create a source.private booleancanHoldFluid(BlockGetter level, BlockPos pos, BlockState state, Fluid fluid) private booleancanPassThrough(BlockGetter level, Fluid fluid, BlockPos pos, BlockState state, Direction direction, BlockPos spreadPos, BlockState spreadState, FluidState fluidState) private booleancanPassThroughWall(Direction direction, BlockGetter level, BlockPos pos, BlockState state, BlockPos spreadPos, BlockState spreadState) protected booleancanSpreadTo(BlockGetter level, BlockPos fromPos, BlockState fromBlockState, Direction direction, BlockPos toPos, BlockState toBlockState, FluidState toFluidState, Fluid fluid) protected voidabstract intgetAmount(FluidState state) private static shortgetCacheKey(BlockPos sourcePos, BlockPos spreadPos) protected abstract intgetDropOff(LevelReader level) getFlow(BlockGetter blockReader, BlockPos pos, FluidState fluidState) abstract FluidgetFlowing(int level, boolean falling) floatgetHeight(FluidState state, BlockGetter level, BlockPos pos) protected static intgetLegacyLevel(FluidState state) protected FluidStategetNewLiquid(Level level, BlockPos pos, BlockState blockState) floatgetOwnHeight(FluidState state) getShape(FluidState state, BlockGetter level, BlockPos pos) protected intgetSlopeDistance(LevelReader level, BlockPos spreadPos, int distance, Direction p_direction, BlockState currentSpreadState, BlockPos sourcePos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<com.mojang.datafixers.util.Pair<BlockState, FluidState>> stateCache, it.unimi.dsi.fastutil.shorts.Short2BooleanMap waterHoleCache) protected abstract intgetSlopeFindDistance(LevelReader level) abstract FluidgetSource(boolean falling) protected Map<Direction, FluidState> getSpread(Level 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 booleanprivate booleanisWaterHole(BlockGetter level, Fluid fluid, BlockPos pos, BlockState state, BlockPos spreadPos, BlockState spreadState) 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(Level level, BlockPos pos, FluidState state) protected voidspreadTo(LevelAccessor level, BlockPos pos, BlockState blockState, Direction direction, FluidState fluidState) private voidspreadToSides(Level level, BlockPos pos, FluidState fluidState, BlockState blockState) voidtick(Level level, BlockPos pos, FluidState state) 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, 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<Block.BlockStatePairKey>> OCCLUSION_CACHE -
shapes
-
-
Constructor Details
-
FlowingFluid
public FlowingFluid()
-
-
Method Details
-
createFluidStateDefinition
- Overrides:
createFluidStateDefinitionin classFluid
-
getFlow
-
affectsFlow
-
isSolidFace
-
spread
-
spreadToSides
-
getNewLiquid
-
canPassThroughWall
private 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, Level, BlockPos)instead. -
spreadTo
protected void spreadTo(LevelAccessor level, BlockPos pos, BlockState blockState, Direction direction, FluidState fluidState) -
beforeDestroyingBlock
-
getCacheKey
-
getSlopeDistance
protected int getSlopeDistance(LevelReader level, BlockPos spreadPos, int distance, Direction p_direction, BlockState currentSpreadState, BlockPos sourcePos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<com.mojang.datafixers.util.Pair<BlockState, FluidState>> stateCache, it.unimi.dsi.fastutil.shorts.Short2BooleanMap waterHoleCache) -
isWaterHole
private boolean isWaterHole(BlockGetter level, Fluid fluid, BlockPos pos, BlockState state, BlockPos spreadPos, BlockState spreadState) -
canPassThrough
private boolean canPassThrough(BlockGetter level, Fluid fluid, 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
-
canHoldFluid
-
canSpreadTo
protected boolean canSpreadTo(BlockGetter level, BlockPos fromPos, BlockState fromBlockState, Direction direction, BlockPos toPos, BlockState toBlockState, FluidState toFluidState, Fluid fluid) -
getDropOff
-
getSpreadDelay
protected int getSpreadDelay(Level level, BlockPos pos, FluidState currentState, FluidState newState) -
tick
-
getLegacyLevel
-
hasSameAbove
-
getHeight
-
getOwnHeight
- Specified by:
getOwnHeightin classFluid
-
getAmount
-
getShape
-
canConvertToSource(FluidState, Level, BlockPos)instead.