Interface XPrisonCurrency

All Known Subinterfaces:
XPrisonGemsAPI, XPrisonTokensAPI

public interface XPrisonCurrency
Represents a generic currency system in the XPrison API. This interface abstracts common currency operations such as querying, adding, removing, and setting amounts for players. Implementations could represent different currency types like Tokens, Gems, etc.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.bukkit.OfflinePlayer player, long amount, ReceiveCause cause)
    Adds a specified amount of currency to the player's balance.
    long
    getAmount(org.bukkit.OfflinePlayer player)
    Gets the current amount of this currency for the specified player.
    void
    remove(org.bukkit.OfflinePlayer player, long amount, LostCause cause)
    Removes a specified amount of currency from the player's balance.
    void
    set(org.bukkit.OfflinePlayer player, long amount)
    Sets the player's currency balance to a new specified amount.
  • Method Details

    • getAmount

      long getAmount(org.bukkit.OfflinePlayer player)
      Gets the current amount of this currency for the specified player.
      Parameters:
      player - The player (offline or online) whose balance to retrieve.
      Returns:
      The amount of currency the player currently has.
    • add

      void add(org.bukkit.OfflinePlayer player, long amount, ReceiveCause cause)
      Adds a specified amount of currency to the player's balance.
      Parameters:
      player - The player to add currency to.
      amount - The amount of currency to add.
      cause - The cause or reason for adding currency (e.g. mining, reward).
    • remove

      void remove(org.bukkit.OfflinePlayer player, long amount, LostCause cause)
      Removes a specified amount of currency from the player's balance.
      Parameters:
      player - The player to remove currency from.
      amount - The amount of currency to remove.
      cause - The cause or reason for removing currency (e.g. purchase, penalty).
    • set

      void set(org.bukkit.OfflinePlayer player, long amount)
      Sets the player's currency balance to a new specified amount.
      Parameters:
      player - The player whose balance to set.
      amount - The new amount to set.