public class Pathfinder extends Object
Constructor and Description |
---|
Pathfinder(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.
|
Modifier and Type | Method and Description |
---|---|
List<org.bukkit.util.Vector> |
getPath(IAlgorithm algorithm)
Used to get the path from this
Pathfinder's start to end points. |
public Pathfinder(GlowBlock startPoint, GlowBlock endPoint)
startPoint
- The starting position.endPoint
- The ending position.public Pathfinder(GlowBlock startPoint, GlowBlock endPoint, org.bukkit.Material... blockedMaterials)
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)
.public Pathfinder(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material,Double> materialWeights)
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)
.public Pathfinder(GlowBlock startPoint, GlowBlock endPoint, Map<org.bukkit.Material,Double> materialWeights, org.bukkit.Material... blockedMaterials)
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)
.public List<org.bukkit.util.Vector> getPath(IAlgorithm algorithm)
Pathfinder's
start to end points.algorithm
- The pathfinding algorithm
to use.Copyright © 2021. All rights reserved.