Package dev.satyrn.xpeconomy.economy
Class PlayerAccountManagerBase
java.lang.Object
dev.satyrn.xpeconomy.economy.PlayerAccountManagerBase
- All Implemented Interfaces:
AccountManager
- Direct Known Subclasses:
MySQLAccountManager
,YamlAccountManager
Manages player accounts.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final List<PlayerAccount>
protected final @NotNull Configuration
-
Constructor Summary
ModifierConstructorDescriptionprotected
PlayerAccountManagerBase
(@NotNull Configuration configuration) Creates a new instance of an account manager. -
Method Summary
Modifier and TypeMethodDescription@NotNull Account
createAccount
(@Nullable org.bukkit.OfflinePlayer player) Creates an account for a player.@Nullable Account
getAccount
(@NotNull UUID uuid) Gets an account with a specific player UUID.protected EconomyMethod
Gets the current economy methodprotected BigDecimal
Gets the starting balance for the account.boolean
hasAccount
(@NotNull UUID uuid) Checks if an account exists for a given player UUID.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.satyrn.xpeconomy.api.economy.AccountManager
load, save
-
Field Details
-
accounts
-
configuration
-
-
Constructor Details
-
PlayerAccountManagerBase
Creates a new instance of an account manager.- Parameters:
configuration
- The configuration manager.
-
-
Method Details
-
hasAccount
Checks if an account exists for a given player UUID.- Specified by:
hasAccount
in interfaceAccountManager
- 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 interfaceAccountManager
- Parameters:
player
- The player instance.- Returns:
- The new account.
-
getAccount
Gets an account with a specific player UUID.- Specified by:
getAccount
in interfaceAccountManager
- Parameters:
uuid
- The player UUID- Returns:
- The account instance.
-
getEconomyMethod
Gets the current economy method- Returns:
- The current economy method.
-
getStartingBalance
Gets the starting balance for the account.- Returns:
- The starting balance.
-