Interface: AdvancedEconomy.java - Hempfest/Hemponomics GitHub Wiki
AdvancedEconomy.java
Economy providers should begin by implementing the AdvancedEconomy
interface found in the com.youtube.hempfest.economy.construct
package.
A few interface members have default implementations to provide basic translation of the null returns from @Nullable
getters. They are #hasWalletAccount
for Wallet
and #hasAccount
for a bank account (Account
).
Methods to override
General
getPlugin()
- Returns Spigot plugin responsible for this implementationgetVersion()
- Return the economy version, perhaps for messages to adminsgetCurrency()
- Return the default/global EconomyCurrency specification in this provider. SeeEconomyCurrency.getCurrencyLayoutBuilder()
for producing anEconomyCurrency
implementationgetCurrency(String world)
- Return the world-specific EconomyCurrency specification for the world specified by name. (You can return same global currency if not implementing world-specific currencies.)getPriority()
- Indicate precedence of this economy provider in a situation where more than one is active.format(BigDecimal)
- Return a String which represents an amount univerallyformat(BigDecimal, Locale)
- Return a String which represents an amount based on the givenLocale
getMaxWalletSize()
- Return a BigDecimal Wallet size limit for use in your implementationisMultiWorld()
- Simple, does this implementation treat worlds independently?isMultiCurrency()
- Are multiple currencies defined? (Right now this seems to be supported best with separate worlds)hasMultiAccountSupport()
- Can players or NPCs have multiple accounts? (unclear atm)hasWalletSizeLimit()
- Does this implementation have a wallet size limit
hasWallets
hasWalletAccount(String)
- deprecated (for system/npc only)hasWalletAccount(String, String)
- deprecated (system/npc)hasWalletAccount(OfflinePlayer)
- Check if a player has a Wallet. It may make sense to override this if you automatically create themhasWalletAccount(OfflinePlayer, String)
- Check if player has a Wallet in String worldhasWalletAccount(UUID)
- Check if a UUID has a WallethasWalletAccount(UUID, String)
- Check if a UUID has a Wallet in String world
hasAccounts
hasAccount(String)
- deprecated (for system/npc only)hasAccount(OfflinePlayer)
- Check if a player has an Account. It may make sense to override this if you automatically create themhasAccount(OfflinePlayer, String)
- Check if player has Account in the world named by StringhasAccount(String, String)
- deprecated (system/npc)hasAccount(UUID)
- Check if a UUID has an AccounthasAccount(UUID, String)
- Check if a UUID has an Account in String world.
getAccounts
getAccount(String)
- deprecated (for system/npc only)getAccount(String, AccountType)
- deprecated (system/npc)getAccount(String, String)
- deprecated (system/npc)getAccount(OfflinePlayer, AccountType)
- Get Account for OfflinePlayer of AccountTypegetAccount(OfflinePlayer)
- Get Account for OfflinePlayergetAccount(String, OfflinePlayer)
- Get Account with account id String accountId for OfflinePlayergetAccount(UUID)
- Get Account by UUIDgetAccount(UUID, AccountType)
- Get Account of UUID with type AccountTypegetAccount(String, UUID)
- Get Account with account id String accountId of UUID
getWallets
getWallet(String)
- deprecated (for system/npc only)getWallet(OfflinePlayer)
- Get Wallet of OfflinePlayergetWallet(UUID)
- Get Wallet of UUID
createAccounts
createAccount(AccountType, String)
- deprecated (for systems/npc)createAccount(AccountType, String, String)
- deprecated (system/npc)createAccount(AccountType, String, BigDecimal)
- deprecated (system/npc)createAccount(AccountType, String, String, String)
- deprecated (system/npc)createAccount(AccountType, String, String, String, BigDecimal)
- deprecated (system/npc)createAccount(AccountType, OfflinePlayer)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, OfflinePlayer, String)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, OfflinePlayer, BigDecimal)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, OfflinePlayer, String, String)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, OfflinePlayer, String, String, BigDecimal)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, UUID)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, UUID, String)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, UUID, BigDecimal)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, UUID, String, String)
- Create an account of AccountType for OfflinePlayercreateAccount(AccountType, UUID, String, String, BigDecimal)
- Create an account of AccountType for OfflinePlayer
deleteWalletAccounts
deleteWalletAccount(Wallet)
- Delete a particular Wallet's datadeleteWalletAccount(Wallet, String)
- Delete a particular Wallet's data for String world
deleteAccounts
deleteAccount(String)
- Delete String Account's datadeleteAccount(String, String)
- Delete String Account's data for String worlddeleteAccount(Account)
- Delete a particular Account's datadeleteAccount(Account, String)
- Delete a particular Account's data for String world
Accounts
getAccounts()
- Return a list of all Accounts in the system. (UseCollections.emptyList()
if you don't want to implement this.)getAccountList()
- Return a string list of all accountIds in the system.