Package dev.selena.luacore.utils.data
Class UserDataManager
java.lang.Object
dev.selena.luacore.utils.data.UserDataManager
Used for internal handling of player data
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetRelativeUserFolderPath
(@NotNull UUID uuid) Used for getting the path inside your plugin data folder excluding /plugins/PLUGIN/<T> T
getUserDataFolder
(Class<T> userFolderClass, UUID uuid) Used for getting the initialized data folder classgetUserFolderPath
(@NotNull UUID uuid) Used for getting the users data path as a string.void
Used for saving all users datavoid
saveUserData
(UserFolder folder) Used for saving the users data
-
Field Details
-
folderName
The folder that the user data is stored in
-
-
Constructor Details
-
UserDataManager
Used for setting up the manager class.- Parameters:
baseFolder
- The base folder for user data to be stored in
-
-
Method Details
-
getUserFolderPath
Used for getting the users data path as a string.- Parameters:
uuid
- The users UUID- Returns:
- The folder path
-
getRelativeUserFolderPath
Used for getting the path inside your plugin data folder excluding /plugins/PLUGIN/- Parameters:
uuid
- the players UUID- Returns:
- the relative folder path
-
getUserDataFolder
@Beta public <T> T getUserDataFolder(Class<T> userFolderClass, UUID uuid) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException, NoUserJsonFoundException Used for getting the initialized data folder class- Type Parameters:
T
- The type of the class- Parameters:
userFolderClass
- The class that extends UserFolderuuid
- The users UUID- Returns:
- The initialized class
- Throws:
NoSuchMethodException
- Thrown on failed class initializationInvocationTargetException
- Thrown on failed class initializationInstantiationException
- Thrown on failed class initializationIllegalAccessException
- Thrown on failed class initializationNoUserJsonFoundException
- Thrown when you have not called theUserFolder.loadData(Class, String)
method.
-
saveUserData
Used for saving the users data- Parameters:
folder
- The UserFolder class- Throws:
IOException
- thrown byConfigLoader.saveConfig(Object, File)
-
saveAllUserData
Used for saving all users data- Throws:
IOException
- thrown byConfigLoader.saveConfig(Object, File)
-