Package net.glowstone.util.pathfinding
Class Pathfinder
java.lang.Object
net.glowstone.util.pathfinding.Pathfinder
A class used for general pathfinding.
-
Constructor Summary
ConstructorDescriptionPathfinder
(GlowBlock startPoint, GlowBlock endPoint) Creates a new pathfinder object using various options.Pathfinder
(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material, Double> materialWeights) Creates a new pathfinder object using various options.Pathfinder
(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material, Double> materialWeights, org.bukkit.Material... blockedMaterials) Creates a new pathfinder object using various options.Pathfinder
(GlowBlock startPoint, GlowBlock endPoint, org.bukkit.Material... blockedMaterials) Creates a new pathfinder object using various options. -
Method Summary
Modifier and TypeMethodDescriptionList<org.bukkit.util.Vector>
getPath
(IAlgorithm algorithm) Used to get the path from thisPathfinder's
start to end points.
-
Constructor Details
-
Pathfinder
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 ofmaterials
that should be blocked from pathing. This is used duringgetPath(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 amaterial
key, with acost
as the value. This is used duringgetPath(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 amaterial
key, with acost
as the value. This is used duringgetPath(IAlgorithm)
.blockedMaterials
- A varargs ofmaterials
that should be blocked from pathing. This is used duringgetPath(IAlgorithm)
.
-
-
Method Details
-
getPath
Used to get the path from thisPathfinder's
start to end points.- Parameters:
algorithm
- The pathfindingalgorithm
to use.- Returns:
- A list of vector's, representing block locations, of the resulting path.
-