Interface IForgeFluid
- All Known Implementing Classes:
EmptyFluid
,FlowingFluid
,Fluid
,ForgeFlowingFluid
,ForgeFlowingFluid.Flowing
,ForgeFlowingFluid.Source
,LavaFluid
,LavaFluid.Flowing
,LavaFluid.Source
,WaterFluid
,WaterFluid.Flowing
,WaterFluid.Source
public interface IForgeFluid
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the non-vanilla fluid attributes, including localized name.default float
getExplosionResistance(FluidState state, BlockGetter world, BlockPos pos, Explosion explosion)
Location sensitive version of getExplosionResistancegetTags()
Retrieves a list of tags names this is known to be associated with.default Boolean
isAABBInsideLiquid(FluidState state, LevelReader world, BlockPos pos, AABB boundingBox)
Called when entities are moving to check if they are inside a liquiddefault Boolean
isAABBInsideMaterial(FluidState state, LevelReader world, BlockPos pos, AABB boundingBox, Material materialIn)
Called when boats or fishing hooks are inside the block to check if they are inside the material requested.default boolean
isEntityInside(FluidState state, LevelReader world, BlockPos pos, Entity entity, double yToTest, SetTag<Fluid> tag, boolean testingHead)
Called when the entity is inside this block, may be used to determined if the entity can breathing, display material overlays, or if the entity can swim inside a block.
-
Method Details
-
isEntityInside
default boolean isEntityInside(FluidState state, LevelReader world, BlockPos pos, Entity entity, double yToTest, SetTag<Fluid> tag, boolean testingHead)Called when the entity is inside this block, may be used to determined if the entity can breathing, display material overlays, or if the entity can swim inside a block.- Parameters:
world
- that is being tested.pos
- position thats being tested.entity
- that is being tested.yToTest
- , primarily for testingHead, which sends the the eye level of the entity, other wise it sends a y that can be tested vs liquid height.tag
- Fluid categorytestingHead
- when true, its testing the entities head for vision, breathing ect... otherwise its testing the body, for swimming and movement adjustment.
-
isAABBInsideMaterial
@Nullable default Boolean isAABBInsideMaterial(FluidState state, LevelReader world, BlockPos pos, AABB boundingBox, Material materialIn)Called when boats or fishing hooks are inside the block to check if they are inside the material requested.- Parameters:
world
- world that is being tested.pos
- block thats being tested.boundingBox
- box to test, generally the bounds of an entity that are besting tested.materialIn
- to check for.- Returns:
- null for default behavior, true if the box is within the material, false if it was not.
-
isAABBInsideLiquid
@Nullable default Boolean isAABBInsideLiquid(FluidState state, LevelReader world, BlockPos pos, AABB boundingBox)Called when entities are moving to check if they are inside a liquid- Parameters:
world
- world that is being tested.pos
- block thats being tested.boundingBox
- box to test, generally the bounds of an entity that are besting tested.- Returns:
- null for default behavior, true if the box is within the material, false if it was not.
-
getExplosionResistance
default float getExplosionResistance(FluidState state, BlockGetter world, BlockPos pos, Explosion explosion)Location sensitive version of getExplosionResistance- Parameters:
world
- The current worldpos
- Block position in worldexplosion
- The explosion- Returns:
- The amount of the explosion absorbed.
-
getTags
Set<ResourceLocation> getTags()Retrieves a list of tags names this is known to be associated with. This should be used in favor of TagCollection.getOwningTags, as this caches the result and automatically updates when the TagCollection changes. -
getAttributes
FluidAttributes getAttributes()Retrieves the non-vanilla fluid attributes, including localized name.
-