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
Waypoint
s to walk between.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.citizensnpcs.trait.waypoint.WaypointProvider
WaypointProvider.EnumerableWaypointProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWaypoint
(Waypoint waypoint) boolean
createEditor
(CommandSender sender, CommandContext args) Creates anWaypointEditor
with the givenCommandSender
.boolean
boolean
isPaused()
Returns whether this provider has paused execution of waypoints.void
void
onRemove()
Called when the provider is removed from the NPC.void
Called when theNPC
attached to this provider is spawned.void
void
setCachePaths
(boolean cachePaths) void
setCycle
(boolean cycle) void
setPaused
(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:WaypointProvider
Creates anWaypointEditor
with the givenCommandSender
.- Specified by:
createEditor
in 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:WaypointProvider
Returns whether this provider has paused execution of waypoints.- Specified by:
isPaused
in interfaceWaypointProvider
- Returns:
- Whether the provider is paused.
-
load
- Specified by:
load
in interfacePersistable
-
onRemove
public void onRemove()Description copied from interface:WaypointProvider
Called when the provider is removed from the NPC.- Specified by:
onRemove
in interfaceWaypointProvider
-
onSpawn
Description copied from interface:WaypointProvider
Called when theNPC
attached to this provider is spawned.- Specified by:
onSpawn
in interfaceWaypointProvider
- Parameters:
npc
- The attached NPC
-
save
- Specified by:
save
in interfacePersistable
-
setCachePaths
public void setCachePaths(boolean cachePaths) -
setCycle
public void setCycle(boolean cycle) -
setPaused
public void setPaused(boolean paused) Description copied from interface:WaypointProvider
Pauses waypoint execution.- Specified by:
setPaused
in interfaceWaypointProvider
- Parameters:
paused
- Whether to pause waypoint execution.
-
waypoints
Returns the modifiable list of waypoints.- Specified by:
waypoints
in interfaceWaypointProvider.EnumerableWaypointProvider
-