Interface DatastoreAPI


public interface DatastoreAPI
  • Method Details

    • get

      @NonNull @NonNull PermissionDataAPI get(UUID uuid)
      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

      @Nullable PermissionDataAPI getFromCache(UUID uuid)
      "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

      boolean setRank(UUID uuid, String rank, long timeLimit)
      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

      boolean buyRank(UUID uuid, String rank, int price, long timeLimit)
      "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 rank
      timeLimit - The time limit in milliseconds.
      Returns:
      A boolean value.
    • setCustomPrefix

      boolean setCustomPrefix(UUID uuid, String prefix, long timeLimit)
      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

      boolean removeCustomPrefix(UUID uuid)
      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

      boolean buyPrefix(UUID uuid, String prefixName, int price, long timeLimit)
      "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

      boolean giveBuyablePrefix(UUID uuid, String prefixName, long timeLimit)
      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

      boolean takeBuyablePrefix(UUID uuid, String prefixName)
      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

      boolean setMainBuyablePrefix(UUID uuid, String prefixName)
      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

      boolean unsetMainBuyablePrefix(UUID uuid)
      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

      String getRankPrefix(String rankName)
      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

      List<RankAPI> getRankList()
      Get a list of all the ranks in the system.
      Returns:
      A list of RankAPI objects.
    • reload

      void reload(UUID uuid)
      Reloads the data for the specified player
      Parameters:
      uuid - The UUID of the player you want to reload.
    • isLoaded

      boolean isLoaded(UUID uuid)
      Returns true if the specified player is loaded
      Parameters:
      uuid - The UUID of the player you want to check.
      Returns:
      A boolean value.
    • unload

      void unload(UUID uuid)
      Unload the player with the given UUID.
      Parameters:
      uuid - The UUID of the player to unload.
    • unload

      default void unload(PermissionDataAPI permissionData)
      Unload a player from the cache
      Parameters:
      permissionData - The PermissionDataAPI object that is being unloaded.