Package net.citizensnpcs.api.npc
Interface NPCDataStore
- All Known Implementing Classes:
- MemoryNPCDataStore,- SimpleNPCDataStore
public interface NPCDataStore
- 
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.intcreateUniqueNPCId(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.
- 
Method Details- 
clearDataClears all data about the givenNPCfrom storage. Called when the NPC is removed.- Parameters:
- npc- The NPC to clear data from
 
- 
clearTraitDataClears all trait data from all NPCs from the given list of names.
- 
createUniqueNPCId- Parameters:
- registry- The registry for the unique ID.
- Returns:
- An ID for a new NPC to identify them uniquely
 
- 
loadIntoLoads NPCs from disk into the givenNPCRegistry. The registry should be cleared before this is called.- Parameters:
- registry- The NPCRegistry to load NPCs into
 
- 
reloadFromSourcevoid reloadFromSource()Reloads the data store from source (such as a file on disk).
- 
saveToDiskvoid saveToDisk()Notifies the data store to save all stored data to disk. May be asynchronous.
- 
saveToDiskImmediatevoid saveToDiskImmediate()Notifies the data store to save all stored data to disk immediately. Must not be asynchronous.
- 
storeStores the givenNPCinto memory or to a disk representation.- Parameters:
- npc- The NPC to store
 
- 
storeAllStores allNPCs in the givenNPCRegistryto disk.- Parameters:
- registry- The registry to store NPCs from
 
 
-