Class AStarAlgorithm

java.lang.Object
net.glowstone.util.pathfinding.algorithms.AStarAlgorithm
All Implemented Interfaces:
IAlgorithm

public class AStarAlgorithm extends Object implements IAlgorithm
An implementation of IAlgorithm for A* Pathfinding.
  • Constructor Details

    • AStarAlgorithm

      public AStarAlgorithm()
  • Method Details

    • calculatePath

      public List<org.bukkit.util.Vector> calculatePath(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material,Double> materialWeights, org.bukkit.Material... blockedMaterials)
      Thanks to www.redblobgames.com/pathfinding/a-star/implementation.html
      Specified by:
      calculatePath in interface IAlgorithm
      Parameters:
      startPoint - The starting position.
      endPoint - The ending position.
      materialWeights - A map containing a material key, with a cost as the value.
      blockedMaterials - A varargs of materials that should be blocked from pathing.
      Returns:
      A list of Vectors that make up the path found during calculation.