Interface DatastoreAPI
public interface DatastoreAPI
-
Method Summary
Modifier and TypeMethodDescriptionboolean"Buy a prefix for a player, and return true if the purchase was successful."boolean"Buy a rank for a player, with a price and time limit."@NonNull PermissionDataAPIGets the PermissionDataAPI object for the given UUID> Returns a list of all the buyable prefixes in the gamegetFromCache(UUID uuid) "Get the permission data for the given UUID from the cache, or null if it's not in the cache."Get a list of all the ranks in the system.getRankPrefix(String rankName) Returns the prefix of the specified rank.booleangiveBuyablePrefix(UUID uuid, String prefixName, long timeLimit) This function gives a player a prefix that they can use for a limited timebooleanReturns true if the specified player is loadedvoidReloads the data for the specified playerbooleanremoveCustomPrefix(UUID uuid) Removes a custom prefix from a playerbooleansetCustomPrefix(UUID uuid, String prefix, long timeLimit) Sets the prefix of a player to a custom prefix for a limited timebooleansetMainBuyablePrefix(UUID uuid, String prefixName) Sets the main buyable prefix of the playerbooleanSets the rank of the specified playerbooleantakeBuyablePrefix(UUID uuid, String prefixName) This function removes a prefix from a playerdefault voidunload(PermissionDataAPI permissionData) Unload a player from the cachevoidUnload the player with the given UUID.booleanunsetMainBuyablePrefix(UUID uuid) Unsets the main buyable prefix for the player with the given UUID
-
Method Details
-
get
Gets the PermissionDataAPI object for the given UUID- Parameters:
uuid- The UUID of the player you want to get the data of.- Returns:
- A PermissionDataAPI object.
-
getFromCache
"Get the permission data for the given UUID from the cache, or null if it's not in the cache."The `@Nullable` annotation is a Java annotation that tells the compiler that the function may return null
- Parameters:
uuid- The UUID of the player you want to get the data from.- Returns:
- A PermissionDataAPI object.
-
setRank
Sets the rank of the specified player- Parameters:
uuid- The UUID of the player you want to set the rank of.rank- The rank you want to set the player to.- Returns:
- A boolean value.
-
buyRank
"Buy a rank for a player, with a price and time limit."The first parameter is the UUID of the player. The second parameter is the name of the rank. The third parameter is the price of the rank. The fourth parameter is the time limit of the rank
- Parameters:
uuid- The UUID of the player who is buying the rank.rank- The rank you want to buy.price- The price of the ranktimeLimit- The time limit in milliseconds.- Returns:
- A boolean value.
-
setCustomPrefix
Sets the prefix of a player to a custom prefix for a limited time- Parameters:
uuid- The UUID of the player you want to set the prefix for.prefix- The prefix you want to set.timeLimit- The time limit in milliseconds.- Returns:
- A boolean value.
-
removeCustomPrefix
Removes a custom prefix from a player- Parameters:
uuid- The UUID of the player you want to remove the prefix from.- Returns:
- A boolean value.
-
buyPrefix
"Buy a prefix for a player, and return true if the purchase was successful."The first parameter is the UUID of the player who is buying the prefix. The second parameter is the name of the prefix that the player is buying. The third parameter is the price of the prefix. The fourth parameter is the time limit of the prefix
- Parameters:
uuid- The UUID of the player who is buying the prefix.prefixName- The name of the prefix you want to buy.price- The price of the prefix.timeLimit- The time limit in milliseconds.- Returns:
- A boolean value.
-
giveBuyablePrefix
This function gives a player a prefix that they can use for a limited time- Parameters:
uuid- The UUID of the player you want to give the prefix to.prefixName- The name of the prefix you want to give to the player.timeLimit- The time limit in milliseconds.- Returns:
- A boolean value.
-
takeBuyablePrefix
This function removes a prefix from a player- Parameters:
uuid- The UUID of the player you want to take the prefix from.prefixName- The name of the prefix you want to take.- Returns:
- A boolean value.
-
setMainBuyablePrefix
Sets the main buyable prefix of the player- Parameters:
uuid- The UUID of the player you want to set the prefix for.prefixName- The name of the prefix you want to set as the main prefix.- Returns:
- A boolean value.
-
unsetMainBuyablePrefix
Unsets the main buyable prefix for the player with the given UUID- Parameters:
uuid- The UUID of the player you want to set the prefix for.- Returns:
- A boolean value.
-
getRankPrefix
Returns the prefix of the specified rank.- Parameters:
rankName- The name of the rank you want to get the prefix for.- Returns:
- A string.
-
getBuyablePrefixList
List<BuyablePrefixAPI> getBuyablePrefixList()> Returns a list of all the buyable prefixes in the game- Returns:
- A list of buyable prefixes.
-
getRankList
Get a list of all the ranks in the system.- Returns:
- A list of RankAPI objects.
-
reload
Reloads the data for the specified player- Parameters:
uuid- The UUID of the player you want to reload.
-
isLoaded
Returns true if the specified player is loaded- Parameters:
uuid- The UUID of the player you want to check.- Returns:
- A boolean value.
-
unload
Unload the player with the given UUID.- Parameters:
uuid- The UUID of the player to unload.
-
unload
Unload a player from the cache- Parameters:
permissionData- The PermissionDataAPI object that is being unloaded.
-