Package net.citizensnpcs.trait.waypoint
Class LinearWaypointProvider
java.lang.Object
net.citizensnpcs.trait.waypoint.LinearWaypointProvider
- All Implemented Interfaces:
Persistable,WaypointProvider,WaypointProvider.EnumerableWaypointProvider
public class LinearWaypointProvider
extends Object
implements WaypointProvider.EnumerableWaypointProvider
An ordered list of
Waypoints to walk between.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.citizensnpcs.trait.waypoint.WaypointProvider
WaypointProvider.EnumerableWaypointProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWaypoint(Waypoint waypoint) booleancreateEditor(CommandSender sender, CommandContext args) Creates anWaypointEditorwith the givenCommandSender.booleanbooleanisPaused()Returns whether this provider has paused execution of waypoints.voidvoidonRemove()Called when the provider is removed from the NPC.voidCalled when theNPCattached to this provider is spawned.voidvoidsetCachePaths(boolean cachePaths) voidsetCycle(boolean cycle) voidsetPaused(boolean paused) Pauses waypoint execution.Returns the modifiable list of waypoints.
-
Constructor Details
-
LinearWaypointProvider
public LinearWaypointProvider() -
LinearWaypointProvider
-
-
Method Details
-
addWaypoint
-
cachePaths
public boolean cachePaths() -
createEditor
Description copied from interface:WaypointProviderCreates anWaypointEditorwith the givenCommandSender.- Specified by:
createEditorin interfaceWaypointProvider- Parameters:
sender- The player to link the editor withargs-- Returns:
- The editor
-
cycleWaypoints
public boolean cycleWaypoints() -
getCurrentWaypoint
-
isPaused
public boolean isPaused()Description copied from interface:WaypointProviderReturns whether this provider has paused execution of waypoints.- Specified by:
isPausedin interfaceWaypointProvider- Returns:
- Whether the provider is paused.
-
load
- Specified by:
loadin interfacePersistable
-
onRemove
public void onRemove()Description copied from interface:WaypointProviderCalled when the provider is removed from the NPC.- Specified by:
onRemovein interfaceWaypointProvider
-
onSpawn
Description copied from interface:WaypointProviderCalled when theNPCattached to this provider is spawned.- Specified by:
onSpawnin interfaceWaypointProvider- Parameters:
npc- The attached NPC
-
save
- Specified by:
savein interfacePersistable
-
setCachePaths
public void setCachePaths(boolean cachePaths) -
setCycle
public void setCycle(boolean cycle) -
setPaused
public void setPaused(boolean paused) Description copied from interface:WaypointProviderPauses waypoint execution.- Specified by:
setPausedin interfaceWaypointProvider- Parameters:
paused- Whether to pause waypoint execution.
-
waypoints
Returns the modifiable list of waypoints.- Specified by:
waypointsin interfaceWaypointProvider.EnumerableWaypointProvider
-