Package net.glowstone.util.pathfinding
Class Pathfinder
java.lang.Object
net.glowstone.util.pathfinding.Pathfinder
A class used for general pathfinding.
-
Constructor Summary
ConstructorsConstructorDescriptionPathfinder(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'sstart 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 ofmaterialsthat 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 amaterialkey, with acostas 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 amaterialkey, with acostas the value. This is used duringgetPath(IAlgorithm).blockedMaterials- A varargs ofmaterialsthat should be blocked from pathing. This is used duringgetPath(IAlgorithm).
-
-
Method Details
-
getPath
Used to get the path from thisPathfinder'sstart to end points.- Parameters:
algorithm- The pathfindingalgorithmto use.- Returns:
- A list of vector's, representing block locations, of the resulting path.
-