diff --git a/Storage.md b/Storage.md index fde87b7..5fd5803 100644 --- a/Storage.md +++ b/Storage.md @@ -9,20 +9,20 @@ storageManager.defineDefaultStorageSystem(FileStorageSystem::new); ``` You can easily create your own by implementing the StorageSystem interface. -## Storage folder -Storage folders are a way to separate your data in multiple categories. There are created/retrieved by calling: +## Storage location +Storage locations are a way to separate your data in multiple categories. There are created/retrieved by calling: ```java -StorageFolder storageFolder = storageManager.getFolder(YOUR_FOLDER_PATH); +StorageLocation storageLocation = getLocation(YOUR_LOCATION_PATH); ``` You can then write/read anything from it as long as you know the key ```java byte[] data; ... -storageFolder.set("test", data); -data = storageFolder.get("test"); +storageLocation.set("test", data); +data = storageLocation.get("test"); ``` -WARNING: You shouldn't open a data folder using a different StorageSystem than the one it has been created with +WARNING: You shouldn't open a data location using a different StorageSystem than the one it has been created with ## Integration with SerializableData Most of the data that you will store will be in the form of SerializableData. ([see data](https://github.com/Minestom/Minestom/wiki/Data)) @@ -34,14 +34,14 @@ There are two kind of SerializableData that you would want to store: For the first type you would need: ```java // The data is gonna be retrieved, cloned and applied to the DataContainer specified -storageFolder.getAndCloneData(key, dataContainer); +storageLocation.getAndCloneData(key, dataContainer); ``` And for the second: ```java // The data is gonna be retrieved, applied to the DataContainer -// And the storage folder will cache it for further saving -storageFolder.getAndCacheData(key, dataContainer); +// And the storage location will cache it for further saving +storageLocation.getAndCacheData(key, dataContainer); ... // Save all the cached SerializableData -storageFolder.saveCachedData(); +storageLocation.saveCachedData(); ``` \ No newline at end of file