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 SummaryModifier 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- 
clearCancelReasonvoid clearCancelReason()Clears the CancelReason returned bygetCancelReason()and attempts to resume pathfinding.
- 
getCancelReasonCancelReason getCancelReason()- Returns:
- The reason for the pathfinding to stop, or null if it is still continuing.
 
- 
getCurrentDestinationLocation getCurrentDestination()- Returns:
- Gets the current movement destination
 
- 
getPath- Returns:
- A copy of the current path, if any
 
- 
getTargetAsLocationLocation getTargetAsLocation()- Returns:
- Gets the target destination location
 
- 
getTargetTypeTargetType getTargetType()- Returns:
- The TargetTypeof this strategy
 
- 
stopvoid stop()Forcibly stops pathfinding. Note that this method does not necessarily set the cancel reason.
- 
updateboolean update()Updates and runs the pathfinding strategy on its current NPC and destination.- Returns:
- Whether pathfinding has completed
 
 
-