Package dev.satyrn.xpeconomy.economy
Class PlayerAccountManagerBase
java.lang.Object
dev.satyrn.xpeconomy.economy.PlayerAccountManagerBase
- All Implemented Interfaces:
ConfigurationConsumer
,AccountManager
- Direct Known Subclasses:
MySQLAccountManager
,YamlAccountManager
public abstract class PlayerAccountManagerBase
extends Object
implements AccountManager, ConfigurationConsumer
Manages player accounts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<PlayerAccount>
protected Configuration
protected EconomyMethod
protected BigDecimal
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
PlayerAccountManagerBase
(@NotNull Configuration configuration) Creates a new instance of an account manager. -
Method Summary
Modifier and TypeMethodDescription@Nullable 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.boolean
hasAccount
(@NotNull UUID uuid) Checks if an account exists for a given player UUID.void
reloadConfiguration
(@NotNull Configuration configuration) Called when the configuration is reloaded.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
-
economyMethod
-
startingBalance
-
configuration
-
-
Constructor Details
-
PlayerAccountManagerBase
Creates a new instance of an account manager.- Parameters:
configuration
- The configuration manager.
-
-
Method Details
-
reloadConfiguration
Called when the configuration is reloaded. Sets the state of the consumer based on the new configuration.- Specified by:
reloadConfiguration
in interfaceConfigurationConsumer
- Parameters:
configuration
- The configuration.
-
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
@Nullable public @Nullable 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.
-