Class PlayerAccountManagerBase

java.lang.Object
dev.satyrn.xpeconomy.economy.PlayerAccountManagerBase
All Implemented Interfaces:
AccountManager
Direct Known Subclasses:
MySQLAccountManager, YamlAccountManager

public abstract class PlayerAccountManagerBase extends Object implements AccountManager
Manages player accounts.
  • Field Details

    • accounts

      protected final transient List<PlayerAccount> accounts
    • configuration

      @NotNull protected final transient @NotNull Configuration configuration
  • Constructor Details

    • PlayerAccountManagerBase

      protected PlayerAccountManagerBase(@NotNull @NotNull Configuration configuration)
      Creates a new instance of an account manager.
      Parameters:
      configuration - The configuration manager.
  • Method Details

    • hasAccount

      public boolean hasAccount(@NotNull @NotNull UUID uuid)
      Checks if an account exists for a given player UUID.
      Specified by:
      hasAccount in interface AccountManager
      Parameters:
      uuid - The player UUID.
      Returns:
      Whether the account exists.
    • createAccount

      @Contract("null -> fail") @NotNull public @NotNull Account createAccount(@Nullable @Nullable org.bukkit.OfflinePlayer player)
      Creates an account for a player.
      Specified by:
      createAccount in interface AccountManager
      Parameters:
      player - The player instance.
      Returns:
      The new account.
    • getAccount

      @Nullable public @Nullable Account getAccount(@NotNull @NotNull UUID uuid)
      Gets an account with a specific player UUID.
      Specified by:
      getAccount in interface AccountManager
      Parameters:
      uuid - The player UUID
      Returns:
      The account instance.
    • getEconomyMethod

      protected EconomyMethod getEconomyMethod()
      Gets the current economy method
      Returns:
      The current economy method.
    • getStartingBalance

      protected BigDecimal getStartingBalance()
      Gets the starting balance for the account.
      Returns:
      The starting balance.