Class Pathfinder

java.lang.Object
net.glowstone.util.pathfinding.Pathfinder

public class Pathfinder extends Object
A class used for general pathfinding.
  • Constructor Details

    • Pathfinder

      public Pathfinder(GlowBlock startPoint, GlowBlock endPoint)
      Creates a new pathfinder object using various options.
      Parameters:
      startPoint - The starting position.
      endPoint - The ending position.
    • Pathfinder

      public Pathfinder(GlowBlock startPoint, GlowBlock endPoint, org.bukkit.Material... blockedMaterials)
      Creates a new pathfinder object using various options.
      Parameters:
      startPoint - The starting position.
      endPoint - The ending position.
      blockedMaterials - A varargs of materials that should be blocked from pathing. This is used during getPath(IAlgorithm).
    • Pathfinder

      public Pathfinder(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material,Double> materialWeights)
      Creates a new pathfinder object using various options.
      Parameters:
      startPoint - The starting position.
      endPoint - The ending position.
      materialWeights - A map containing a material key, with a cost as the value. This is used during getPath(IAlgorithm).
    • Pathfinder

      public Pathfinder(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material,Double> materialWeights, org.bukkit.Material... blockedMaterials)
      Creates a new pathfinder object using various options.
      Parameters:
      startPoint - The starting position.
      endPoint - The ending position.
      materialWeights - A map containing a material key, with a cost as the value. This is used during getPath(IAlgorithm).
      blockedMaterials - A varargs of materials that should be blocked from pathing. This is used during getPath(IAlgorithm).
  • Method Details

    • getPath

      public List<org.bukkit.util.Vector> getPath(IAlgorithm algorithm)
      Used to get the path from this Pathfinder's start to end points.
      Parameters:
      algorithm - The pathfinding algorithm to use.
      Returns:
      A list of vector's, representing block locations, of the resulting path.