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 implementation
  • getVersion() - Return the economy version, perhaps for messages to admins
  • getCurrency() - Return the default/global EconomyCurrency specification in this provider. See EconomyCurrency.getCurrencyLayoutBuilder() for producing an EconomyCurrency implementation
  • getCurrency(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 univerally
  • format(BigDecimal, Locale) - Return a String which represents an amount based on the given Locale
  • getMaxWalletSize() - Return a BigDecimal Wallet size limit for use in your implementation
  • isMultiWorld() - 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 them
  • hasWalletAccount(OfflinePlayer, String) - Check if player has a Wallet in String world
  • hasWalletAccount(UUID) - Check if a UUID has a Wallet
  • hasWalletAccount(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 them
  • hasAccount(OfflinePlayer, String) - Check if player has Account in the world named by String
  • hasAccount(String, String) - deprecated (system/npc)
  • hasAccount(UUID) - Check if a UUID has an Account
  • hasAccount(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 AccountType
  • getAccount(OfflinePlayer) - Get Account for OfflinePlayer
  • getAccount(String, OfflinePlayer) - Get Account with account id String accountId for OfflinePlayer
  • getAccount(UUID) - Get Account by UUID
  • getAccount(UUID, AccountType) - Get Account of UUID with type AccountType
  • getAccount(String, UUID) - Get Account with account id String accountId of UUID
getWallets
  • getWallet(String) - deprecated (for system/npc only)
  • getWallet(OfflinePlayer) - Get Wallet of OfflinePlayer
  • getWallet(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 OfflinePlayer
  • createAccount(AccountType, OfflinePlayer, String) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, OfflinePlayer, BigDecimal) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, OfflinePlayer, String, String) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, OfflinePlayer, String, String, BigDecimal) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, UUID) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, UUID, String) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, UUID, BigDecimal) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, UUID, String, String) - Create an account of AccountType for OfflinePlayer
  • createAccount(AccountType, UUID, String, String, BigDecimal) - Create an account of AccountType for OfflinePlayer
deleteWalletAccounts
  • deleteWalletAccount(Wallet) - Delete a particular Wallet's data
  • deleteWalletAccount(Wallet, String) - Delete a particular Wallet's data for String world
deleteAccounts
  • deleteAccount(String) - Delete String Account's data
  • deleteAccount(String, String) - Delete String Account's data for String world
  • deleteAccount(Account) - Delete a particular Account's data
  • deleteAccount(Account, String) - Delete a particular Account's data for String world
Accounts
  • getAccounts() - Return a list of all Accounts in the system. (Use Collections.emptyList() if you don't want to implement this.)
  • getAccountList() - Return a string list of all accountIds in the system.