Class PreciseGroundNodeGenerator

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

public class PreciseGroundNodeGenerator extends Object implements NodeGenerator
  • Constructor Details

    • PreciseGroundNodeGenerator

      public PreciseGroundNodeGenerator()
  • Method Details

    • getWalkable

      public Collection<? extends PNode> getWalkable(Block.Getter getter, Set<PNode> visited, PNode current, Point goal, 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

      public OptionalDouble gravitySnap(Block.Getter getter, double pointOrgX, double pointOrgY, double pointOrgZ, 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
    • canMoveTowards

      public boolean canMoveTowards(Block.Getter getter, Point startOrg, Point endOrg, BoundingBox boundingBox)
      Description copied from interface: NodeGenerator
      Check if we can move directly from one point to another
      Specified by:
      canMoveTowards in interface NodeGenerator
      Parameters:
      getter -
      startOrg -
      endOrg -
      boundingBox -
      Returns:
      true if we can move directly from start to end