Class GroundNodeGenerator

java.lang.Object
net.minestom.server.entity.pathfinding.generators.GroundNodeGenerator
All Implemented Interfaces:
NodeGenerator

public class GroundNodeGenerator extends Object implements NodeGenerator
  • Constructor Details

    • GroundNodeGenerator

      public GroundNodeGenerator()
  • Method Details

    • getWalkable

      @NotNull public @NotNull Collection<? extends PNode> getWalkable(@NotNull Block.Getter getter, @NotNull @NotNull Set<PNode> visited, @NotNull @NotNull PNode current, @NotNull @NotNull Point goal, @NotNull @NotNull BoundingBox boundingBox)
      Description copied from interface: NodeGenerator
      Gets the walkable nodes.
      Specified by:
      getWalkable in interface NodeGenerator
      Parameters:
      getter - the instance
      visited - the visited nodes
      current - the current node
      goal - the goal
      boundingBox - the bounding box
      Returns:
      the walkable nodes
    • hasGravitySnap

      public boolean hasGravitySnap()
      Specified by:
      hasGravitySnap in interface NodeGenerator
      Returns:
      snap start and end points to the ground
    • gravitySnap

      @NotNull public @NotNull OptionalDouble gravitySnap(@NotNull Block.Getter getter, double pointOrgX, double pointOrgY, double pointOrgZ, @NotNull @NotNull BoundingBox boundingBox, double maxFall)
      Description copied from interface: NodeGenerator
      Snap point to the ground
      Specified by:
      gravitySnap in interface NodeGenerator
      Parameters:
      getter - the block getter
      pointOrgX - the x coordinate
      pointOrgY - the y coordinate
      pointOrgZ - the z coordinate
      boundingBox - the bounding box
      maxFall - the maximum fall distance
      Returns:
      the snapped y coordinate. Empty if the snap point is not found