public final class CitizensAPI extends Object
Modifier and Type | Method and Description |
---|---|
static NPCRegistry |
createAnonymousNPCRegistry(NPCDataStore store)
Creates a new anonymous
NPCRegistry with its own set of NPC s. |
static NPCRegistry |
createCitizensBackedNPCRegistry(NPCDataStore store)
Creates a new anonymous
NPCRegistry that is "Citizens-backed" i.e. |
static NPCRegistry |
createNamedNPCRegistry(String name,
NPCDataStore store)
Creates a new
NPCRegistry with its own set of NPC s. |
static File |
getDataFolder() |
static NPCSelector |
getDefaultNPCSelector() |
static NPCRegistry |
getNamedNPCRegistry(String name)
Retrieves the
NPCRegistry previously created via createNamedNPCRegistry(String, NPCDataStore)
with the given name, or null if not found. |
static Iterable<NPCRegistry> |
getNPCRegistries() |
static NPCRegistry |
getNPCRegistry()
Gets the current implementation's default
NPCRegistry . |
static org.bukkit.plugin.Plugin |
getPlugin() |
static ScriptCompiler |
getScriptCompiler() |
static File |
getScriptFolder() |
static SkullMetaProvider |
getSkullMetaProvider() |
static SpeechFactory |
getSpeechFactory()
Gets the current implementation's
SpeechFactory . |
static TraitFactory |
getTraitFactory()
Gets the current implementation's
TraitFactory . |
static boolean |
hasImplementation() |
static void |
registerEvents(org.bukkit.event.Listener listener)
A helper method for registering events using the current implementation's
Plugin . |
static void |
removeNamedNPCRegistry(String name)
Removes any previously created
NPCRegistry stored under the given name. |
static void |
setImplementation(CitizensPlugin implementation)
Sets the current Citizens implementation.
|
static void |
shutdown()
Shuts down any resources currently being held.
|
public static NPCRegistry createAnonymousNPCRegistry(NPCDataStore store)
NPCRegistry
with its own set of NPC
s. This is not stored by the
Citizens plugin.store
- The NPCDataStore
to use with the registrygetNamedNPCRegistry(String)
public static NPCRegistry createCitizensBackedNPCRegistry(NPCDataStore store)
NPCRegistry
that is "Citizens-backed" i.e. will reload and unload at the
same time that Citizens reloads and unloads.store
- The NPCDataStore
to use with the registrypublic static NPCRegistry createNamedNPCRegistry(String name, NPCDataStore store)
NPCRegistry
with its own set of NPC
s. This is stored in memory with the Citizens
plugin, and can be accessed via getNamedNPCRegistry(String)
.name
- The plugin namestore
- The NPCDataStore
to use with the registrygetNamedNPCRegistry(String)
public static File getDataFolder()
public static NPCSelector getDefaultNPCSelector()
public static NPCRegistry getNamedNPCRegistry(String name)
NPCRegistry
previously created via createNamedNPCRegistry(String, NPCDataStore)
with the given name, or null if not found.name
- The registry namecreateNamedNPCRegistry(String, NPCDataStore)
, or null if
not foundpublic static Iterable<NPCRegistry> getNPCRegistries()
public static NPCRegistry getNPCRegistry()
NPCRegistry
.public static org.bukkit.plugin.Plugin getPlugin()
Plugin
providing an implementationpublic static ScriptCompiler getScriptCompiler()
ScriptCompiler
public static File getScriptFolder()
public static SkullMetaProvider getSkullMetaProvider()
public static SpeechFactory getSpeechFactory()
SpeechFactory
.CitizensPlugin
public static TraitFactory getTraitFactory()
TraitFactory
.CitizensPlugin
public static boolean hasImplementation()
public static void registerEvents(org.bukkit.event.Listener listener)
Plugin
.listener
- The listener to register events forgetPlugin()
public static void removeNamedNPCRegistry(String name)
NPCRegistry
stored under the given name.name
- The name previously given to createNamedNPCRegistry(String, NPCDataStore)
public static void setImplementation(CitizensPlugin implementation)
implementation
- The new implementationpublic static void shutdown()
Copyright © 2021. All rights reserved.