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

      @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
    • canMoveTowards

      public boolean canMoveTowards(@NotNull Block.Getter getter, @NotNull @NotNull Point startOrg, @NotNull @NotNull Point endOrg, @NotNull @NotNull 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