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 Configurationprotected EconomyMethodprotected BigDecimal -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPlayerAccountManagerBase(@NotNull Configuration configuration) Creates a new instance of an account manager. -
Method Summary
Modifier and TypeMethodDescription@Nullable AccountcreateAccount(@Nullable org.bukkit.OfflinePlayer player) Creates an account for a player.@Nullable AccountgetAccount(@NotNull UUID uuid) Gets an account with a specific player UUID.booleanhasAccount(@NotNull UUID uuid) Checks if an account exists for a given player UUID.voidreloadConfiguration(@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, waitMethods 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:
reloadConfigurationin interfaceConfigurationConsumer- Parameters:
configuration- The configuration.
-
hasAccount
Checks if an account exists for a given player UUID.- Specified by:
hasAccountin 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:
createAccountin interfaceAccountManager- Parameters:
player- The player instance.- Returns:
- The new account.
-
getAccount
Gets an account with a specific player UUID.- Specified by:
getAccountin interfaceAccountManager- Parameters:
uuid- The player UUID- Returns:
- The account instance.
-