Skip to content

Commit

Permalink
Add new Navigator APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Nov 22, 2020
1 parent e0507a7 commit d715cc0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions src/main/java/net/citizensnpcs/api/ai/Navigator.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ public interface Navigator {
*/
void setTarget(Entity target, boolean aggressive);

/**
* Sets the current navigation to an entity target.
*
* @param target
* The {@link Entity} to path towards
* @param aggressive
* Whether to attack the target when close enough
*/
void setTarget(Entity target, boolean aggressive, PathStrategy strategy);

/**
* Sets the current navigation using a list of {@link Vector}s which will be followed in turn.
*
Expand All @@ -102,11 +112,27 @@ public interface Navigator {
*/
void setTarget(Iterable<Vector> path);

/**
* Sets the current navigation to a {@link Location} destination.
*
* @param target
* The destination
*/
void setTarget(Iterable<Vector> path, PathStrategy strategy);

/**
* Sets the current navigation to a {@link Location} destination.
*
* @param target
* The destination
*/
void setTarget(Location target);

/**
* Sets the current navigation to a {@link Location} destination.
*
* @param target
* The destination
*/
void setTarget(Location target, PathStrategy strategy);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public HandlerList getHandlers() {
* @return Location where the NPC was spawned
*/
public Location getLocation() {
return location;
return location.clone();
}

/**
Expand Down

0 comments on commit d715cc0

Please sign in to comment.