Package net.citizensnpcs.api.npc
Class SimpleNPCDataStore
java.lang.Object
net.citizensnpcs.api.npc.SimpleNPCDataStore
- All Implemented Interfaces:
- NPCDataStore
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidClears all data about the givenNPCfrom storage.voidclearTraitData(Iterable<String> traitNames) Clears all trait data from all NPCs from the given list of names.static NPCDataStoreintcreateUniqueNPCId(NPCRegistry registry) voidloadInto(NPCRegistry registry) Loads NPCs from disk into the givenNPCRegistry.voidReloads the data store from source (such as a file on disk).voidNotifies the data store to save all stored data to disk.voidNotifies the data store to save all stored data to disk immediately.voidStores the givenNPCinto memory or to a disk representation.voidstoreAll(NPCRegistry registry) Stores allNPCs in the givenNPCRegistryto disk.
- 
Constructor Details- 
SimpleNPCDataStore
 
- 
- 
Method Details- 
clearDataDescription copied from interface:NPCDataStoreClears all data about the givenNPCfrom storage. Called when the NPC is removed.- Specified by:
- clearDatain interface- NPCDataStore
- Parameters:
- npc- The NPC to clear data from
 
- 
clearTraitDataDescription copied from interface:NPCDataStoreClears all trait data from all NPCs from the given list of names.- Specified by:
- clearTraitDatain interface- NPCDataStore
 
- 
createUniqueNPCId- Specified by:
- createUniqueNPCIdin interface- NPCDataStore
- Parameters:
- registry- The registry for the unique ID.
- Returns:
- An ID for a new NPC to identify them uniquely
 
- 
loadIntoDescription copied from interface:NPCDataStoreLoads NPCs from disk into the givenNPCRegistry. The registry should be cleared before this is called.- Specified by:
- loadIntoin interface- NPCDataStore
- Parameters:
- registry- The NPCRegistry to load NPCs into
 
- 
reloadFromSourcepublic void reloadFromSource()Description copied from interface:NPCDataStoreReloads the data store from source (such as a file on disk).- Specified by:
- reloadFromSourcein interface- NPCDataStore
 
- 
saveToDiskpublic void saveToDisk()Description copied from interface:NPCDataStoreNotifies the data store to save all stored data to disk. May be asynchronous.- Specified by:
- saveToDiskin interface- NPCDataStore
 
- 
saveToDiskImmediatepublic void saveToDiskImmediate()Description copied from interface:NPCDataStoreNotifies the data store to save all stored data to disk immediately. Must not be asynchronous.- Specified by:
- saveToDiskImmediatein interface- NPCDataStore
 
- 
storeDescription copied from interface:NPCDataStoreStores the givenNPCinto memory or to a disk representation.- Specified by:
- storein interface- NPCDataStore
- Parameters:
- npc- The NPC to store
 
- 
storeAllDescription copied from interface:NPCDataStoreStores allNPCs in the givenNPCRegistryto disk.- Specified by:
- storeAllin interface- NPCDataStore
- Parameters:
- registry- The registry to store NPCs from
 
- 
create
 
-