Package net.citizensnpcs.trait.waypoint
Class Waypoints
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.waypoint.Waypoints
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddescribeProviders(CommandSender sender) Returns the currentWaypointProvider.getEditor(CommandSender player, CommandContext args) voidLoads a trait.voidonAttach()Called when the trait has been attached to anNPC.voidonSpawn()Called when anNPCis spawned.static voidregisterWaypointProvider(Class<? extends WaypointProvider> clazz, String name) Registers aWaypointProvider, which can be subsequently used by NPCs.voidSaves a trait.booleansetWaypointProvider(String name) Sets the currentWaypointProviderusing the given name.
-
Constructor Details
-
Waypoints
public Waypoints()
-
-
Method Details
-
describeProviders
-
getCurrentProvider
Returns the currentWaypointProvider. May be null during initialisation.- Returns:
- The current provider
-
getCurrentProviderName
- Returns:
- The current provider name
-
getEditor
-
load
Description copied from class:TraitLoads a trait.- Overrides:
loadin classTrait- Parameters:
key- DataKey to load from- Throws:
NPCLoadException- Thrown if this trait failed to load properly
-
onAttach
public void onAttach()Description copied from class:Trait -
onSpawn
public void onSpawn()Description copied from class:TraitCalled when anNPCis spawned.NPC.getEntity()will return null until this is called. This is also called onAttach when the NPC is already spawned. -
save
Description copied from class:TraitSaves a trait. -
setWaypointProvider
Sets the currentWaypointProviderusing the given name.- Parameters:
name- The name of the waypoint provider, registered usingregisterWaypointProvider(Class, String)- Returns:
- Whether the operation succeeded
-
registerWaypointProvider
Registers aWaypointProvider, which can be subsequently used by NPCs.- Parameters:
clazz- The class of the waypoint providername- The name of the waypoint provider
-