Class PreciseGroundNodeGenerator
java.lang.Object
net.minestom.server.entity.pathfinding.generators.PreciseGroundNodeGenerator
- All Implemented Interfaces:
NodeGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMoveTowards(Block.Getter getter, Point startOrg, Point endOrg, BoundingBox boundingBox) Check if we can move directly from one point to anotherCollection<? extends PNode> getWalkable(Block.Getter getter, Set<PNode> visited, PNode current, Point goal, BoundingBox boundingBox) Gets the walkable nodes.gravitySnap(Block.Getter getter, double pointOrgX, double pointOrgY, double pointOrgZ, BoundingBox boundingBox, double maxFall) Snap point to the groundbooleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NodeGenerator
heuristic, pointInvalid
-
Constructor Details
-
PreciseGroundNodeGenerator
public PreciseGroundNodeGenerator()
-
-
Method Details
-
getWalkable
public Collection<? extends PNode> getWalkable(Block.Getter getter, Set<PNode> visited, PNode current, Point goal, BoundingBox boundingBox) Description copied from interface:NodeGeneratorGets the walkable nodes.- Specified by:
getWalkablein interfaceNodeGenerator- Parameters:
getter- the instancevisited- the visited nodescurrent- the current nodegoal- the goalboundingBox- the bounding box- Returns:
- the walkable nodes
-
hasGravitySnap
public boolean hasGravitySnap()- Specified by:
hasGravitySnapin interfaceNodeGenerator- Returns:
- snap start and end points to the ground
-
gravitySnap
public OptionalDouble gravitySnap(Block.Getter getter, double pointOrgX, double pointOrgY, double pointOrgZ, BoundingBox boundingBox, double maxFall) Description copied from interface:NodeGeneratorSnap point to the ground- Specified by:
gravitySnapin interfaceNodeGenerator- Parameters:
getter- the block getterpointOrgX- the x coordinatepointOrgY- the y coordinatepointOrgZ- the z coordinateboundingBox- the bounding boxmaxFall- the maximum fall distance- Returns:
- the snapped y coordinate. Empty if the snap point is not found
-
canMoveTowards
public boolean canMoveTowards(Block.Getter getter, Point startOrg, Point endOrg, BoundingBox boundingBox) Description copied from interface:NodeGeneratorCheck if we can move directly from one point to another- Specified by:
canMoveTowardsin interfaceNodeGenerator- Parameters:
getter-startOrg-endOrg-boundingBox-- Returns:
- true if we can move directly from start to end
-