Package net.citizensnpcs.npc.ai
Class CitizensNavigator
java.lang.Object
net.citizensnpcs.npc.ai.CitizensNavigator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCancels any running navigation towards a target.Returns theNavigatorParameterslocal to this navigator.Returns the currentEntityTargetof the navigator, if any.Returns theNavigatorParameterslocal to any current target execution.getNPC()booleanbooleanisPaused()voidvoidvoidonSpawn()voidrun()voidvoidsetPaused(boolean paused) Sets whether the navigator is paused and shouldn't process the path for now.voidSets the current navigation using a list ofVectors which will be followed in turn.voidsetTarget(Iterable<Vector> path, Function<NavigatorParameters, PathStrategy> strategy) Sets the current navigation to aLocationdestination.voidSets the current navigation to an entity target.voidsetTarget(Entity target, boolean aggressive, Function<NavigatorParameters, PathStrategy> strategy) Sets the current navigation to an entity target.voidSets the current navigation to aLocationdestination.voidsetTarget(Location target, Function<NavigatorParameters, PathStrategy> strategy) Sets the current navigation to aLocationdestination.
-
Constructor Details
-
CitizensNavigator
-
-
Method Details
-
getDefaultParameters
Description copied from interface:NavigatorReturns theNavigatorParameterslocal to this navigator. These parameters are copied to local target parameters when a new target is started.- Specified by:
getDefaultParametersin interfaceNavigator- Returns:
- The default parameters
- See Also:
-
getEntityTarget
Description copied from interface:NavigatorReturns the currentEntityTargetof the navigator, if any. May return null.- Specified by:
getEntityTargetin interfaceNavigator- Returns:
- The current entity target
-
getLocalParameters
Description copied from interface:NavigatorReturns theNavigatorParameterslocal to any current target execution. These are updated independently of the default parameters.- Specified by:
getLocalParametersin interfaceNavigator- Returns:
- The local parameters
- See Also:
-
getNPC
-
getPathStrategy
- Specified by:
getPathStrategyin interfaceNavigator- Returns:
- The current
PathStrategyor null if the navigator is not pathfinding
-
getTargetAsLocation
Description copied from interface:NavigatorReturns the currentLocationbeing navigated towards - this is not necessarily permanent and may change, for example when pathing towards a movingEntity. May return null.- Specified by:
getTargetAsLocationin interfaceNavigator- Returns:
- The target location
-
getTargetType
- Specified by:
getTargetTypein interfaceNavigator- Returns:
- The current
TargetTypeof the navigator
-
isPaused
public boolean isPaused() -
load
-
onDespawn
public void onDespawn() -
onSpawn
public void onSpawn() -
run
public void run() -
save
-
setPaused
public void setPaused(boolean paused) Description copied from interface:NavigatorSets whether the navigator is paused and shouldn't process the path for now. -
setTarget
Description copied from interface:NavigatorSets the current navigation to an entity target. -
setTarget
public void setTarget(Entity target, boolean aggressive, Function<NavigatorParameters, PathStrategy> strategy) Description copied from interface:NavigatorSets the current navigation to an entity target. -
setTarget
Description copied from interface:NavigatorSets the current navigation using a list ofVectors which will be followed in turn. -
setTarget
Description copied from interface:NavigatorSets the current navigation to aLocationdestination. -
setTarget
Description copied from interface:NavigatorSets the current navigation to aLocationdestination. -
setTarget
Description copied from interface:NavigatorSets the current navigation to aLocationdestination.