Package net.fabricmc.fabric.api.registry
Interface LandPathNodeTypesRegistry.DynamicPathNodeTypeProvider
- All Superinterfaces:
LandPathNodeTypesRegistry.PathNodeTypeProvider
- Enclosing class:
LandPathNodeTypesRegistry
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static non-sealed interface LandPathNodeTypesRegistry.DynamicPathNodeTypeProvider
extends LandPathNodeTypesRegistry.PathNodeTypeProvider
A functional interface that provides the
PathNodeType
, given the block state world and position.-
Method Summary
Modifier and TypeMethodDescription@Nullable PathNodeType
getPathNodeType
(BlockState state, BlockView world, BlockPos pos, boolean neighbor) Gets thePathNodeType
for the specified block state at the specified position.
-
Method Details
-
getPathNodeType
@Nullable @Nullable PathNodeType getPathNodeType(BlockState state, BlockView world, BlockPos pos, boolean neighbor) Gets thePathNodeType
for the specified block state at the specified position.You can specify what to return if the block state is a direct target of an entity path, or a neighbor block of the entity path.
For example, for a cactus-like block you should specify
PathNodeType.DAMAGE_OTHER
if the block is a direct target (neighbor == false
) to specify that an entity should not pass through or above the block because it will cause damage, andPathNodeType.DANGER_OTHER
if the cactus will be found as a neighbor block in the entity path (neighbor == true
) to specify that the entity should not get close to the block because is dangerous.- Parameters:
state
- Current block state.world
- Current world.pos
- Current position.neighbor
- Specifies that the block is in a direct neighbor position to an entity path (directly next to a block that the entity will pass through or above).- Returns:
- the custom
PathNodeType
registered for the specified block state at the specified position.
-