Package net.neoforged.neoforge.fluids
Class BaseFlowingFluid
java.lang.Object
net.minecraft.world.level.material.Fluid
net.minecraft.world.level.material.FlowingFluid
net.neoforged.neoforge.fluids.BaseFlowingFluid
- All Implemented Interfaces:
IFluidExtension
- Direct Known Subclasses:
BaseFlowingFluid.Flowing
,BaseFlowingFluid.Source
Base implementation of a
FlowingFluid
for mods to use.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final @Nullable Supplier
<? extends LiquidBlock> private final float
private final int
private final int
private final int
Fields inherited from class net.minecraft.world.level.material.FlowingFluid
FALLING, LEVEL
Fields inherited from class net.minecraft.world.level.material.Fluid
FLUID_STATE_REGISTRY, stateDefinition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
beforeDestroyingBlock
(LevelAccessor worldIn, BlockPos pos, BlockState state) protected boolean
canBeReplacedWith
(FluidState state, BlockGetter level, BlockPos pos, Fluid fluidIn, Direction direction) protected boolean
canConvertToSource
(Level level) boolean
canConvertToSource
(FluidState state, Level level, BlockPos pos) Returns whether the fluid can create a source.protected BlockState
createLegacyBlock
(FluidState state) protected int
getDropOff
(LevelReader worldIn) protected float
Returns the type of this fluid.protected int
getSlopeFindDistance
(LevelReader worldIn) int
getTickDelay
(LevelReader level) boolean
Methods inherited from class net.minecraft.world.level.material.FlowingFluid
canSpreadTo, createFluidStateDefinition, getAmount, getFlow, getFlowing, getHeight, getLegacyLevel, getNewLiquid, getOwnHeight, getShape, getSlopeDistance, getSource, getSpread, getSpreadDelay, isSolidFace, spread, spreadTo, tick
Methods inherited from class net.minecraft.world.level.material.Fluid
animateTick, builtInRegistryHolder, defaultFluidState, getDripParticle, getStateDefinition, is, isEmpty, isRandomlyTicking, 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.neoforged.neoforge.common.extensions.IFluidExtension
canExtinguish, canHydrate, getAdjacentBlockPathType, getBlockPathType, getExplosionResistance, move, supportsBoating
-
Field Details
-
fluidType
-
flowing
-
still
-
bucket
-
block
-
slopeFindDistance
private final int slopeFindDistance -
levelDecreasePerBlock
private final int levelDecreasePerBlock -
explosionResistance
private final float explosionResistance -
tickRate
private final int tickRate
-
-
Constructor Details
-
BaseFlowingFluid
-
-
Method Details
-
getFluidType
Description copied from interface:IFluidExtension
Returns the type of this fluid.Important: This MUST be overridden on your fluid, otherwise an error will be thrown.
- Specified by:
getFluidType
in interfaceIFluidExtension
- Overrides:
getFluidType
in classFluid
- Returns:
- the type of this fluid
-
getFlowing
- Specified by:
getFlowing
in classFlowingFluid
-
getSource
- Specified by:
getSource
in classFlowingFluid
-
canConvertToSource
- Specified by:
canConvertToSource
in classFlowingFluid
-
canConvertToSource
Description copied from interface:IFluidExtension
Returns whether the fluid can create a source.- Specified by:
canConvertToSource
in interfaceIFluidExtension
- Overrides:
canConvertToSource
in classFlowingFluid
- 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
-
beforeDestroyingBlock
- Specified by:
beforeDestroyingBlock
in classFlowingFluid
-
getSlopeFindDistance
- Specified by:
getSlopeFindDistance
in classFlowingFluid
-
getDropOff
- Specified by:
getDropOff
in classFlowingFluid
-
getBucket
-
canBeReplacedWith
protected boolean canBeReplacedWith(FluidState state, BlockGetter level, BlockPos pos, Fluid fluidIn, Direction direction) - Specified by:
canBeReplacedWith
in classFluid
-
getTickDelay
- Specified by:
getTickDelay
in classFluid
-
getExplosionResistance
protected float getExplosionResistance()- Specified by:
getExplosionResistance
in classFluid
-
createLegacyBlock
- Specified by:
createLegacyBlock
in classFluid
-
isSame
-
getPickupSound
- Overrides:
getPickupSound
in classFluid
-