Constructor and Description |
---|
CitizensNavigator(NPC npc) |
Modifier and Type | Method and Description |
---|---|
void |
cancelNavigation()
Cancels any running navigation towards a target.
|
NavigatorParameters |
getDefaultParameters()
Returns the
NavigatorParameters local to this navigator. |
EntityTarget |
getEntityTarget()
Returns the current
EntityTarget of the navigator, if any. |
NavigatorParameters |
getLocalParameters()
Returns the
NavigatorParameters local to any current target execution. |
NPC |
getNPC() |
PathStrategy |
getPathStrategy() |
org.bukkit.Location |
getTargetAsLocation()
Returns the current
Location being navigated towards - this is not necessarily permanent and may change,
for example when pathing towards a moving Entity . |
TargetType |
getTargetType() |
boolean |
isNavigating() |
boolean |
isPaused() |
void |
load(DataKey root) |
void |
onDespawn() |
void |
onSpawn() |
void |
run() |
void |
save(DataKey root) |
void |
setPaused(boolean paused)
Sets whether the navigator is paused and shouldn't process the path for now.
|
void |
setTarget(org.bukkit.entity.Entity target,
boolean aggressive)
Sets the current navigation to an entity target.
|
void |
setTarget(org.bukkit.entity.Entity target,
boolean aggressive,
Function<NavigatorParameters,PathStrategy> strategy)
Sets the current navigation to an entity target.
|
void |
setTarget(Iterable<org.bukkit.util.Vector> path)
Sets the current navigation using a list of
Vector s which will be followed in turn. |
void |
setTarget(Iterable<org.bukkit.util.Vector> path,
Function<NavigatorParameters,PathStrategy> strategy)
Sets the current navigation to a
Location destination. |
void |
setTarget(org.bukkit.Location targetIn)
Sets the current navigation to a
Location destination. |
void |
setTarget(org.bukkit.Location target,
Function<NavigatorParameters,PathStrategy> strategy)
Sets the current navigation to a
Location destination. |
public CitizensNavigator(NPC npc)
public void cancelNavigation()
Navigator
cancelNavigation
in interface Navigator
public NavigatorParameters getDefaultParameters()
Navigator
NavigatorParameters
local to this navigator. These parameters are copied to local target
parameters when a new target is started.getDefaultParameters
in interface Navigator
Navigator.getLocalParameters()
public EntityTarget getEntityTarget()
Navigator
EntityTarget
of the navigator, if any. May return null.getEntityTarget
in interface Navigator
public NavigatorParameters getLocalParameters()
Navigator
NavigatorParameters
local to any current target execution. These are updated independently of
the default parameters.getLocalParameters
in interface Navigator
Navigator.getDefaultParameters()
public NPC getNPC()
public PathStrategy getPathStrategy()
getPathStrategy
in interface Navigator
PathStrategy
or null if the navigator is not pathfindingpublic org.bukkit.Location getTargetAsLocation()
Navigator
Location
being navigated towards - this is not necessarily permanent and may change,
for example when pathing towards a moving Entity
. May return null.getTargetAsLocation
in interface Navigator
public TargetType getTargetType()
getTargetType
in interface Navigator
TargetType
of the navigatorpublic boolean isNavigating()
isNavigating
in interface Navigator
Navigator.getTargetType()
public boolean isPaused()
public void load(DataKey root)
public void onDespawn()
public void onSpawn()
public void save(DataKey root)
public void setPaused(boolean paused)
Navigator
public void setTarget(org.bukkit.entity.Entity target, boolean aggressive)
Navigator
public void setTarget(org.bukkit.entity.Entity target, boolean aggressive, Function<NavigatorParameters,PathStrategy> strategy)
Navigator
public void setTarget(Iterable<org.bukkit.util.Vector> path)
Navigator
Vector
s which will be followed in turn.public void setTarget(Iterable<org.bukkit.util.Vector> path, Function<NavigatorParameters,PathStrategy> strategy)
Navigator
Location
destination.public void setTarget(org.bukkit.Location targetIn)
Navigator
Location
destination.public void setTarget(org.bukkit.Location target, Function<NavigatorParameters,PathStrategy> strategy)
Navigator
Location
destination.Copyright © 2021. All rights reserved.