Class WaterNodeGenerator

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

public class WaterNodeGenerator extends Object implements NodeGenerator
  • Constructor Details

    • WaterNodeGenerator

      public WaterNodeGenerator()
  • 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 pointX, double pointY, double pointZ, @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
      pointX - the x coordinate
      pointY - the y coordinate
      pointZ - 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