Package net.citizensnpcs.api.persistence
Interface Persister<T>
- All Known Implementing Classes:
ComponentPersister,EulerAnglePersister,ItemStackPersister,LocationPersister,NamespacedKeyPersister,PersisterRegistry,PotionEffectPersister,QuaternionfPersister,UUIDPersister,VectorPersister,WaypointTriggerRegistry
public interface Persister<T>
A serialisation primitive to be used with
PersistenceLoader to serialise custom objects.-
Method Summary
-
Method Details
-
create
Creates an object instance from the givenDataKey. Should not return null unless no data is present.- Parameters:
root- The root key to load from- Returns:
- The created instance, or null if no data was present
-
save
Saves the object instance to the givenDataKey.- Parameters:
instance- The object instance to saveroot- The key to save into
-