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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable Supplier<? extends LiquidBlock> private final floatprivate final intprivate final intprivate final intFields inherited from class net.minecraft.world.level.material.FlowingFluid
FALLING, LEVELFields inherited from class net.minecraft.world.level.material.Fluid
FLUID_STATE_REGISTRY, stateDefinition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbeforeDestroyingBlock(LevelAccessor worldIn, BlockPos pos, BlockState state) protected booleancanBeReplacedWith(FluidState state, BlockGetter level, BlockPos pos, Fluid fluidIn, Direction direction) protected booleancanConvertToSource(Level level) booleancanConvertToSource(FluidState state, Level level, BlockPos pos) Returns whether the fluid can create a source.protected BlockStatecreateLegacyBlock(FluidState state) protected intgetDropOff(LevelReader worldIn) protected floatReturns the type of this fluid.protected intgetSlopeFindDistance(LevelReader worldIn) intgetTickDelay(LevelReader level) booleanMethods 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, tickMethods inherited from class net.minecraft.world.level.material.Fluid
animateTick, builtInRegistryHolder, defaultFluidState, getDripParticle, getStateDefinition, is, isEmpty, isRandomlyTicking, isSource, randomTick, registerDefaultStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:IFluidExtensionReturns the type of this fluid.Important: This MUST be overridden on your fluid, otherwise an error will be thrown.
- Specified by:
getFluidTypein interfaceIFluidExtension- Overrides:
getFluidTypein classFluid- Returns:
- the type of this fluid
-
getFlowing
- Specified by:
getFlowingin classFlowingFluid
-
getSource
- Specified by:
getSourcein classFlowingFluid
-
canConvertToSource
- Specified by:
canConvertToSourcein classFlowingFluid
-
canConvertToSource
Description copied from interface:IFluidExtensionReturns whether the fluid can create a source.- Specified by:
canConvertToSourcein interfaceIFluidExtension- Overrides:
canConvertToSourcein classFlowingFluid- 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
-
beforeDestroyingBlock
- Specified by:
beforeDestroyingBlockin classFlowingFluid
-
getSlopeFindDistance
- Specified by:
getSlopeFindDistancein classFlowingFluid
-
getDropOff
- Specified by:
getDropOffin classFlowingFluid
-
getBucket
-
canBeReplacedWith
protected boolean canBeReplacedWith(FluidState state, BlockGetter level, BlockPos pos, Fluid fluidIn, Direction direction) - Specified by:
canBeReplacedWithin classFluid
-
getTickDelay
- Specified by:
getTickDelayin classFluid
-
getExplosionResistance
protected float getExplosionResistance()- Specified by:
getExplosionResistancein classFluid
-
createLegacyBlock
- Specified by:
createLegacyBlockin classFluid
-
isSame
-
getPickupSound
- Overrides:
getPickupSoundin classFluid
-