Module net.minestom.server
Class WaterNodeGenerator
java.lang.Object
net.minestom.server.entity.pathfinding.generators.WaterNodeGenerator
- All Implemented Interfaces:
NodeGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection
<? extends PNode> getWalkable
(Block.Getter getter, Set<PNode> visited, PNode current, Point goal, BoundingBox boundingBox) Gets the walkable nodes.gravitySnap
(Block.Getter getter, double pointX, double pointY, double pointZ, BoundingBox boundingBox, double maxFall) Snap point to the groundboolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.entity.pathfinding.generators.NodeGenerator
canMoveTowards, heuristic, pointInvalid
-
Constructor Details
-
WaterNodeGenerator
public WaterNodeGenerator()
-
-
Method Details
-
getWalkable
public Collection<? extends PNode> getWalkable(Block.Getter getter, Set<PNode> visited, PNode current, Point goal, BoundingBox boundingBox) Description copied from interface:NodeGenerator
Gets the walkable nodes.- Specified by:
getWalkable
in 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:
hasGravitySnap
in interfaceNodeGenerator
- Returns:
- snap start and end points to the ground
-
gravitySnap
public OptionalDouble gravitySnap(Block.Getter getter, double pointX, double pointY, double pointZ, BoundingBox boundingBox, double maxFall) Description copied from interface:NodeGenerator
Snap point to the ground- Specified by:
gravitySnap
in interfaceNodeGenerator
- Parameters:
getter
- the block getterpointX
- the x coordinatepointY
- the y coordinatepointZ
- the z coordinateboundingBox
- the bounding boxmaxFall
- the maximum fall distance- Returns:
- the snapped y coordinate. Empty if the snap point is not found
-