public interface IAlgorithm
Modifier and Type | Method and Description |
---|---|
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
|
default Set<org.bukkit.util.Vector> |
getCornerNeighbors(org.bukkit.util.Vector vector)
Used to get the locations that neighbor a vector's corners.
|
default Set<org.bukkit.util.Vector> |
getFaceNeighbors(org.bukkit.util.Vector vector)
Used to get the locations that neighbor a vector's faces.
|
default Map<org.bukkit.util.Vector,Double> |
getNeighbors(org.bukkit.Location location,
Map<org.bukkit.Material,Double> materialWeights,
Set<org.bukkit.Material> blockedMaterials)
Used to get the locations, as vectors, of neighboring blocks.
|
List<org.bukkit.util.Vector> calculatePath(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.blockedMaterials
- A varargs of materials
that should be
blocked from pathing.Vectors
that make up the path found during calculation.default Map<org.bukkit.util.Vector,Double> getNeighbors(org.bukkit.Location location, Map<org.bukkit.Material,Double> materialWeights, Set<org.bukkit.Material> blockedMaterials)
location
- The location used in the calculation of neighbors.materialWeights
- A map containing a material
key, with
a cost
as the value.blockedMaterials
- A set of materials that should be ignored.default Set<org.bukkit.util.Vector> getFaceNeighbors(org.bukkit.util.Vector vector)
vector
- The vector we're grabbing the face neighbors of.default Set<org.bukkit.util.Vector> getCornerNeighbors(org.bukkit.util.Vector vector)
vector
- The vector we're grabbing the corner neighbors of.Copyright © 2021. All rights reserved.