Package net.citizensnpcs.trait.waypoint
Class GuidedWaypointProvider
java.lang.Object
net.citizensnpcs.trait.waypoint.GuidedWaypointProvider
- All Implemented Interfaces:
Persistable
,WaypointProvider
,WaypointProvider.EnumerableWaypointProvider
public class GuidedWaypointProvider
extends Object
implements WaypointProvider.EnumerableWaypointProvider
Stores guided waypoint info. Guided waypoints are a list of
Waypoint
s that will be navigated between
randomly. Helper waypoints can be used to guide navigation between the random waypoints i.e. navigating between guide
waypoints. For example, you might have a "realistic" NPC that walks between houses using helper waypoints placed
along the roads.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.citizensnpcs.trait.waypoint.WaypointProvider
WaypointProvider.EnumerableWaypointProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDestination
(Waypoint waypoint) void
addDestinations
(Collection<Waypoint> waypoint) void
void
addGuides
(Collection<Waypoint> helper) createEditor
(CommandSender sender, CommandContext args) Creates anWaypointEditor
with the givenCommandSender
.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
setPaused
(boolean paused) Pauses waypoint execution.Returns destination and guide waypoints.
-
Constructor Details
-
GuidedWaypointProvider
public GuidedWaypointProvider()
-
-
Method Details
-
addDestination
-
addDestinations
-
addGuide
-
addGuides
-
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
-
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
-
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 destination and guide waypoints.- Specified by:
waypoints
in interfaceWaypointProvider.EnumerableWaypointProvider
-