Interface IFluidStateExtension
public interface IFluidStateExtension
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canConvertToSource
(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Returns whether the fluid can create a source.default boolean
canExtinguish
(net.minecraft.world.level.BlockGetter getter, net.minecraft.core.BlockPos pos) Returns whether the block can be extinguished by this fluid.default boolean
canHydrate
(net.minecraft.world.level.BlockGetter getter, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState source, net.minecraft.core.BlockPos sourcePos) Returns whether the block can be hydrated by a fluid.default @Nullable net.minecraft.world.level.pathfinder.PathType
getAdjacentBlockPathType
(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Mob mob, net.minecraft.world.level.pathfinder.PathType originalType) Gets the path type of the adjacent fluid to a pathfinding entity.default @Nullable net.minecraft.world.level.pathfinder.PathType
getBlockPathType
(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Mob mob, boolean canFluidLog) Gets the path type of this fluid when an entity is pathfinding.default float
getExplosionResistance
(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion) Returns the explosion resistance of the fluid.default FluidType
Returns the type of this fluid.default boolean
move
(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.phys.Vec3 movementVector, double gravity) Performs how an entity moves when within the fluid.private net.minecraft.world.level.material.FluidState
self()
default boolean
supportsBoating
(net.minecraft.world.entity.vehicle.AbstractBoat boat) Returns whether the boat can be used on the fluid.
-
Method Details
-
self
private net.minecraft.world.level.material.FluidState self() -
getExplosionResistance
default float getExplosionResistance(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Explosion explosion) Returns the explosion resistance of the fluid.- Parameters:
level
- the level the fluid is inpos
- the position of the fluidexplosion
- the explosion the fluid is absorbing- Returns:
- the amount of the explosion the fluid can absorb
-
getFluidType
Returns the type of this fluid.- Returns:
- the type of this fluid
-
move
default boolean move(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.phys.Vec3 movementVector, double gravity) Performs how an entity moves when within the fluid. If using custom movement logic, the method should returntrue
. Otherwise, the movement logic will default to water.- Parameters:
entity
- the entity moving within the fluidmovementVector
- the velocity of how the entity wants to movegravity
- the gravity to apply to the entity- Returns:
true
if custom movement logic is performed,false
otherwise
-
canConvertToSource
default boolean canConvertToSource(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos) Returns whether the fluid can create a source.- Parameters:
level
- the level that can get the fluidpos
- the location of the fluid- Returns:
true
if the fluid can create a source,false
otherwise
-
supportsBoating
default boolean supportsBoating(net.minecraft.world.entity.vehicle.AbstractBoat boat) Returns whether the boat can be used on the fluid.- Parameters:
boat
- the boat trying to be used on the fluid- Returns:
true
if the boat can be used,false
otherwise
-
getBlockPathType
@Nullable default @Nullable net.minecraft.world.level.pathfinder.PathType getBlockPathType(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.Mob mob, boolean canFluidLog) Gets the path type of this fluid when an entity is pathfinding. Whennull
, uses vanilla behavior.- Parameters:
level
- the level which contains this fluidpos
- the position of the fluidmob
- the mob currently pathfinding, may benull
canFluidLog
-true
if the path is being applied for fluids that can log blocks, should be checked against if the fluid can log a block- Returns:
- the path type of this fluid
-
getAdjacentBlockPathType
@Nullable default @Nullable net.minecraft.world.level.pathfinder.PathType getAdjacentBlockPathType(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.Mob mob, net.minecraft.world.level.pathfinder.PathType originalType) Gets the path type of the adjacent fluid to a pathfinding entity. Path types with a negative malus are not traversable for the entity. Pathfinding entities will favor paths consisting of a lower malus. Whennull
, uses vanilla behavior.- Parameters:
level
- the level which contains this fluidpos
- the position of the fluidmob
- the mob currently pathfinding, may benull
originalType
- the path type of the source the entity is on- Returns:
- the path type of this fluid
-
canHydrate
default boolean canHydrate(net.minecraft.world.level.BlockGetter getter, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState source, net.minecraft.core.BlockPos sourcePos) Returns whether the block can be hydrated by a fluid.Hydration is an arbitrary word which depends on the block.
- A farmland has moisture
- A sponge can soak up the liquid
- A coral can live
- Parameters:
getter
- the getter which can get the fluidpos
- the position of the fluidsource
- the state of the block being hydratedsourcePos
- the position of the block being hydrated- Returns:
true
if the block can be hydrated,false
otherwise
-
canExtinguish
default boolean canExtinguish(net.minecraft.world.level.BlockGetter getter, net.minecraft.core.BlockPos pos) Returns whether the block can be extinguished by this fluid.- Parameters:
getter
- the getter which can get the fluidpos
- the position of the fluid- Returns:
true
if the block can be extinguished,false
otherwise
-