Package net.citizensnpcs.api.ai
Interface PathStrategy
- All Known Implementing Classes:
AbstractPathStrategy,AStarNavigationStrategy,FlyingAStarNavigationStrategy,MCNavigationStrategy,MCTargetStrategy,StraightLineNavigationStrategy
public interface PathStrategy
A pathfinding strategy directed at a target. Has two states: pathfinding -> cancelled represented by
getCancelReason().-
Method Summary
Modifier and TypeMethodDescriptionvoidClears the CancelReason returned bygetCancelReason()and attempts to resume pathfinding.getPath()voidstop()Forcibly stops pathfinding.booleanupdate()Updates and runs the pathfinding strategy on its current NPC and destination.
-
Method Details
-
clearCancelReason
void clearCancelReason()Clears the CancelReason returned bygetCancelReason()and attempts to resume pathfinding. -
getCancelReason
CancelReason getCancelReason()- Returns:
- The reason for the pathfinding to stop, or null if it is still continuing.
-
getCurrentDestination
Location getCurrentDestination()- Returns:
- Gets the current movement destination
-
getPath
- Returns:
- A copy of the current path, if any
-
getTargetAsLocation
Location getTargetAsLocation()- Returns:
- Gets the target destination location
-
getTargetType
TargetType getTargetType()- Returns:
- The
TargetTypeof this strategy
-
stop
void stop()Forcibly stops pathfinding. Note that this method does not necessarily set the cancel reason. -
update
boolean update()Updates and runs the pathfinding strategy on its current NPC and destination.- Returns:
- Whether pathfinding has completed
-