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
public abstract class BaseFlowingFluid
extends net.minecraft.world.level.material.FlowingFluid
Base implementation of a
FlowingFluid
for mods to use.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
Nested classes/interfaces inherited from class net.minecraft.world.level.material.FlowingFluid
net.minecraft.world.level.material.FlowingFluid.SpreadContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable Supplier
<? extends net.minecraft.world.level.block.LiquidBlock> private final @Nullable Supplier
<? extends net.minecraft.world.item.Item> private final float
private final Supplier
<? extends net.minecraft.world.level.material.Fluid> private final int
private final int
private final Supplier
<? extends net.minecraft.world.level.material.Fluid> 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
beforeDestroyingBlock
(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) protected boolean
canBeReplacedWith
(net.minecraft.world.level.material.FluidState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.Fluid fluidIn, net.minecraft.core.Direction direction) protected boolean
canConvertToSource
(net.minecraft.server.level.ServerLevel level) boolean
canConvertToSource
(net.minecraft.world.level.material.FluidState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Returns whether the fluid can create a source.protected net.minecraft.world.level.block.state.BlockState
createLegacyBlock
(net.minecraft.world.level.material.FluidState state) net.minecraft.world.item.Item
protected int
getDropOff
(net.minecraft.world.level.LevelReader worldIn) protected float
net.minecraft.world.level.material.Fluid
Returns the type of this fluid.Optional
<net.minecraft.sounds.SoundEvent> protected int
getSlopeFindDistance
(net.minecraft.world.level.LevelReader worldIn) net.minecraft.world.level.material.Fluid
int
getTickDelay
(net.minecraft.world.level.LevelReader level) boolean
isSame
(net.minecraft.world.level.material.Fluid fluidIn) Methods inherited from class net.minecraft.world.level.material.FlowingFluid
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, entityInside, getAABB, getDripParticle, getStateDefinition, is, isEmpty, isRandomlyTicking, 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
-
fluidType
-
flowing
-
still
-
bucket
-
block
@Nullable private final @Nullable Supplier<? extends net.minecraft.world.level.block.LiquidBlock> 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 classnet.minecraft.world.level.material.Fluid
- Returns:
- the type of this fluid
-
getFlowing
public net.minecraft.world.level.material.Fluid getFlowing()- Specified by:
getFlowing
in classnet.minecraft.world.level.material.FlowingFluid
-
getSource
public net.minecraft.world.level.material.Fluid getSource()- Specified by:
getSource
in classnet.minecraft.world.level.material.FlowingFluid
-
canConvertToSource
protected boolean canConvertToSource(net.minecraft.server.level.ServerLevel level) - Specified by:
canConvertToSource
in classnet.minecraft.world.level.material.FlowingFluid
-
canConvertToSource
public boolean canConvertToSource(net.minecraft.world.level.material.FluidState state, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Description copied from interface:IFluidExtension
Returns whether the fluid can create a source.- Specified by:
canConvertToSource
in interfaceIFluidExtension
- Overrides:
canConvertToSource
in classnet.minecraft.world.level.material.FlowingFluid
- 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
protected void beforeDestroyingBlock(net.minecraft.world.level.LevelAccessor worldIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) - Specified by:
beforeDestroyingBlock
in classnet.minecraft.world.level.material.FlowingFluid
-
getSlopeFindDistance
protected int getSlopeFindDistance(net.minecraft.world.level.LevelReader worldIn) - Specified by:
getSlopeFindDistance
in classnet.minecraft.world.level.material.FlowingFluid
-
getDropOff
protected int getDropOff(net.minecraft.world.level.LevelReader worldIn) - Specified by:
getDropOff
in classnet.minecraft.world.level.material.FlowingFluid
-
getBucket
public net.minecraft.world.item.Item getBucket()- Specified by:
getBucket
in classnet.minecraft.world.level.material.Fluid
-
canBeReplacedWith
protected boolean canBeReplacedWith(net.minecraft.world.level.material.FluidState state, net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.material.Fluid fluidIn, net.minecraft.core.Direction direction) - Specified by:
canBeReplacedWith
in classnet.minecraft.world.level.material.Fluid
-
getTickDelay
public int getTickDelay(net.minecraft.world.level.LevelReader level) - Specified by:
getTickDelay
in classnet.minecraft.world.level.material.Fluid
-
getExplosionResistance
protected float getExplosionResistance()- Specified by:
getExplosionResistance
in classnet.minecraft.world.level.material.Fluid
-
createLegacyBlock
protected net.minecraft.world.level.block.state.BlockState createLegacyBlock(net.minecraft.world.level.material.FluidState state) - Specified by:
createLegacyBlock
in classnet.minecraft.world.level.material.Fluid
-
isSame
public boolean isSame(net.minecraft.world.level.material.Fluid fluidIn) - Overrides:
isSame
in classnet.minecraft.world.level.material.Fluid
-
getPickupSound
- Overrides:
getPickupSound
in classnet.minecraft.world.level.material.Fluid
-