Constructor and Description |
---|
Waypoints() |
Modifier and Type | Method and Description |
---|---|
void |
describeProviders(org.bukkit.command.CommandSender sender) |
WaypointProvider |
getCurrentProvider()
Returns the current
WaypointProvider . |
String |
getCurrentProviderName() |
Editor |
getEditor(org.bukkit.command.CommandSender player,
CommandContext args) |
void |
load(DataKey key)
Loads a trait.
|
void |
onAttach()
Called when the trait has been attached to an
NPC . |
void |
onSpawn()
Called when an
NPC is spawned. |
static void |
registerWaypointProvider(Class<? extends WaypointProvider> clazz,
String name)
Registers a
WaypointProvider , which can be subsequently used by NPCs. |
void |
save(DataKey key)
Saves a trait.
|
boolean |
setWaypointProvider(String name)
Sets the current
WaypointProvider using the given name. |
public void describeProviders(org.bukkit.command.CommandSender sender)
public WaypointProvider getCurrentProvider()
WaypointProvider
. May be null during initialisation.public String getCurrentProviderName()
public Editor getEditor(org.bukkit.command.CommandSender player, CommandContext args)
public void load(DataKey key) throws NPCLoadException
Trait
load
in class Trait
key
- DataKey to load fromNPCLoadException
- Thrown if this trait failed to load properlypublic void onAttach()
Trait
public void onSpawn()
Trait
NPC
is spawned. NPC.getEntity()
will return null until this is called. This is
also called onAttach when the NPC is already spawned.public boolean setWaypointProvider(String name)
WaypointProvider
using the given name.name
- The name of the waypoint provider, registered using registerWaypointProvider(Class, String)
public static void registerWaypointProvider(Class<? extends WaypointProvider> clazz, String name)
WaypointProvider
, which can be subsequently used by NPCs.clazz
- The class of the waypoint providername
- The name of the waypoint providerCopyright © 2021. All rights reserved.