Interface IForgeFluidState
- All Known Implementing Classes:
- FluidState
public interface IForgeFluidState
- 
Method SummaryModifier and TypeMethodDescriptiondefault booleancanConvertToSource(Level level, BlockPos pos) Returns whether the fluid can create a source.default booleancanExtinguish(BlockGetter getter, BlockPos pos) Returns whether the block can be extinguished by this fluid.default booleancanHydrate(BlockGetter getter, BlockPos pos, BlockState source, BlockPos sourcePos) Returns whether the block can be hydrated by a fluid.default @Nullable BlockPathTypesgetAdjacentBlockPathType(BlockGetter level, BlockPos pos, @Nullable Mob mob, BlockPathTypes originalType) Gets the path type of the adjacent fluid to a pathfinding entity.default @Nullable BlockPathTypesgetBlockPathType(BlockGetter level, BlockPos pos, @Nullable Mob mob, boolean canFluidLog) Gets the path type of this fluid when an entity is pathfinding.default floatgetExplosionResistance(BlockGetter level, BlockPos pos, Explosion explosion) Returns the explosion resistance of the fluid.default FluidTypeReturns the type of this fluid.default booleanmove(LivingEntity entity, Vec3 movementVector, double gravity) Performs how an entity moves when within the fluid.private FluidStateself()default booleanshouldUpdateWhileBoating(Boat boat, Entity rider) Whenfalse, the fluid will no longer update its height value while within a boat while it is not within a fluid (Boat.isUnderWater().default booleansupportsBoating(Boat boat) Returns whether the boat can be used on the fluid.
- 
Method Details- 
self
- 
getExplosionResistanceReturns the explosion resistance of the fluid.- Parameters:
- level- the level the fluid is in
- pos- the position of the fluid
- explosion- the explosion the fluid is absorbing
- Returns:
- the amount of the explosion the fluid can absorb
 
- 
getFluidTypeReturns the type of this fluid.- Returns:
- the type of this fluid
 
- 
movePerforms 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 fluid
- movementVector- the velocity of how the entity wants to move
- gravity- the gravity to apply to the entity
- Returns:
- trueif custom movement logic is performed,- falseotherwise
 
- 
canConvertToSourceReturns whether the fluid can create a source.- Parameters:
- level- the level that can get the fluid
- pos- the location of the fluid
- Returns:
- trueif the fluid can create a source,- falseotherwise
 
- 
supportsBoatingReturns whether the boat can be used on the fluid.- Parameters:
- boat- the boat trying to be used on the fluid
- Returns:
- trueif the boat can be used,- falseotherwise
 
- 
shouldUpdateWhileBoatingWhenfalse, the fluid will no longer update its height value while within a boat while it is not within a fluid (Boat.isUnderWater().- Parameters:
- boat- the boat the rider is within that is not inside a fluid
- rider- the rider of the boat
- Returns:
- trueif the fluid height should be updated,- falseotherwise
 
- 
getBlockPathType@Nullable default @Nullable BlockPathTypes getBlockPathType(BlockGetter level, BlockPos pos, @Nullable @Nullable 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 fluid
- pos- the position of the fluid
- mob- the mob currently pathfinding, may be- null
- canFluidLog-- trueif 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 BlockPathTypes getAdjacentBlockPathType(BlockGetter level, BlockPos pos, @Nullable @Nullable Mob mob, BlockPathTypes 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 fluid
- pos- the position of the fluid
- mob- the mob currently pathfinding, may be- null
- originalType- the path type of the source the entity is on
- Returns:
- the path type of this fluid
 
- 
canHydrateReturns 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 fluid
- pos- the position of the fluid
- source- the state of the block being hydrated
- sourcePos- the position of the block being hydrated
- Returns:
- trueif the block can be hydrated,- falseotherwise
 
- 
canExtinguishReturns whether the block can be extinguished by this fluid.- Parameters:
- getter- the getter which can get the fluid
- pos- the position of the fluid
- Returns:
- trueif the block can be extinguished,- falseotherwise
 
 
-