Package net.citizensnpcs.api
Class CitizensAPI
java.lang.Object
net.citizensnpcs.api.CitizensAPI
Contains methods used in order to utilize the Citizens API.
- 
Method SummaryModifier and TypeMethodDescriptionstatic NPCRegistryCreates a new anonymousNPCRegistrywith its own set ofNPCs.static NPCRegistryCreates a newNPCRegistrywith its own set ofNPCs that does not save to disk.static NPCRegistrycreateNamedNPCRegistry(String name, NPCDataStore store) Creates a newNPCRegistrywith its own set ofNPCs.static CommandManagerstatic Filestatic NPCSelectorstatic LocationLookupstatic NPCRegistrygetNamedNPCRegistry(String name) Retrieves theNPCRegistrypreviously created viacreateNamedNPCRegistry(String, NPCDataStore)with the given name, or null if not found.static NMSHelperstatic Iterable<NPCRegistry> static NPCRegistryGets the current implementation's defaultNPCRegistry.static Pluginstatic TemplateRegistrystatic NPCRegistryGets the current implementation's default temporaryNPCRegistry.static TraitFactoryGets the current implementation'sTraitFactory.static booleanstatic voidregisterEvents(Listener listener) A helper method for registering events using the current implementation'sPlugin.static voidremoveNamedNPCRegistry(String name) Removes any previously createdNPCRegistrystored under the given name.static voidsetImplementation(CitizensPlugin implementation) Sets the current Citizens implementation.static voidshutdown()Shuts down any resources currently being held.static voidtalk(SpeechContext context) 
- 
Method Details- 
createAnonymousNPCRegistryCreates a new anonymousNPCRegistrywith its own set ofNPCs. This is not stored by the Citizens plugin.- Parameters:
- store- The- NPCDataStoreto use with the registry
- Returns:
- A new anonymous NPCRegistry that is not accessible via getNamedNPCRegistry(String)
- Since:
- 2.0.8
 
- 
createInMemoryNPCRegistryCreates a newNPCRegistrywith its own set ofNPCs that does not save to disk.
- 
createNamedNPCRegistryCreates a newNPCRegistrywith its own set ofNPCs. This is stored in memory with the Citizens plugin, and can be accessed viagetNamedNPCRegistry(String).- Parameters:
- name- The plugin name
- store- The- NPCDataStoreto use with the registry
- Returns:
- A new NPCRegistry, that can also be retrieved via getNamedNPCRegistry(String)
- Since:
- 2.0.8
 
- 
getCommandManager
- 
getDataFolder- Returns:
- The data folder of the current implementation
 
- 
getDefaultNPCSelector- Returns:
- The default NPC selector
 
- 
getLocationLookup
- 
getNamedNPCRegistryRetrieves theNPCRegistrypreviously created viacreateNamedNPCRegistry(String, NPCDataStore)with the given name, or null if not found.- Parameters:
- name- The registry name
- Returns:
- A NPCRegistry previously created via createNamedNPCRegistry(String, NPCDataStore), or null if not found
- Since:
- 2.0.8
 
- 
getNMSHelper
- 
getNPCRegistries
- 
getNPCRegistryGets the current implementation's defaultNPCRegistry.- Returns:
- The NPC registry
 
- 
getPlugin- Returns:
- The current Pluginproviding an implementation
 
- 
getTemplateRegistry
- 
getTemporaryNPCRegistryGets the current implementation's default temporaryNPCRegistry.- Returns:
- The temporary NPC registry
 
- 
getTraitFactoryGets the current implementation'sTraitFactory.- Returns:
- Citizens trait factory
- See Also:
 
- 
hasImplementationpublic static boolean hasImplementation()- Returns:
- Whether a Citizens implementation is currently present
 
- 
registerEventsA helper method for registering events using the current implementation'sPlugin.- Parameters:
- listener- The listener to register events for
- See Also:
 
- 
removeNamedNPCRegistryRemoves any previously createdNPCRegistrystored under the given name.- Parameters:
- name- The name previously given to- createNamedNPCRegistry(String, NPCDataStore)
- Since:
- 2.0.8
 
- 
setImplementationSets the current Citizens implementation.- Parameters:
- implementation- The new implementation
 
- 
shutdownpublic static void shutdown()Shuts down any resources currently being held.
- 
talk
 
-