Interface EconomyService
Unlike other services provided by the API, the economy service does **not** have an implementation registered by default. Since Vanilla has no concept of economy, the economy service implementation must always be provided by a plugin. This service exists to provide a common API which can be used by implementors and consumers.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the defaultCurrencyused by theEconomyService.deleteAccount(String identifier) Deletes the account with the specified identifier.deleteAccount(UUID uuid) Deletes the account for the user with the specifiedUUID.findOrCreateAccount(String identifier) Gets theVirtualAccountwith the specified identifier.findOrCreateAccount(UUID uuid) Gets theUniqueAccountfor the user with the specifiedUUID.booleanhasAccount(String identifier) Returns whether anAccountwith the specified identifier exists.booleanhasAccount(UUID uuid) Returns whether aUniqueAccountexists with the specifiedUUID.Gets aStreamof all availableUniqueAccounts.Gets aStreamof all availableVirtualAccounts.Gets aCollectionof all availableUniqueAccounts.Gets aCollectionof all availableVirtualAccounts.
-
Method Details
-
defaultCurrency
Currency defaultCurrency()Retrieves the defaultCurrencyused by theEconomyService.- Returns:
Currencydefault for the EconomyService- See Also:
-
hasAccount
Returns whether aUniqueAccountexists with the specifiedUUID.- Parameters:
uuid- TheUUIDof the account to check for- Returns:
- Whether a
UniqueAccountexists with the specifiedUUID
-
hasAccount
Returns whether anAccountwith the specified identifier exists.Depending on the implementation, the
Accountmay be aUniqueAccountor aVirtualAccount.- Parameters:
identifier- The identifier of the account to check for- Returns:
- Whether an
Accountwith the specified identifier exists
-
findOrCreateAccount
Gets theUniqueAccountfor the user with the specifiedUUID.If an account does not already exist with the specified
UUID, it will be created.Creation might fail if the provided
UUIDdoes not correspond to an actual player, or for an implementation-defined reason.- Parameters:
uuid- TheUUIDof the account to get.- Returns:
- The
UniqueAccount, if available.
-
findOrCreateAccount
Gets theVirtualAccountwith the specified identifier.Depending on the implementation, the
Accountmay be aUniqueAccountor aVirtualAccount.If an account does not already exist with the specified identifier, it will be created.
Creation may fail for an implementation-defined reason.
- Parameters:
identifier- The identifier of the account to get.- Returns:
- The
Account, if available.
-
streamUniqueAccounts
Stream<UniqueAccount> streamUniqueAccounts()Gets aStreamof all availableUniqueAccounts.- Returns:
- A stream of all
UniqueAccounts.
-
uniqueAccounts
Collection<UniqueAccount> uniqueAccounts()Gets aCollectionof all availableUniqueAccounts.- Returns:
- A Collection of all
UniqueAccounts.
-
streamVirtualAccounts
Stream<VirtualAccount> streamVirtualAccounts()Gets aStreamof all availableVirtualAccounts.- Returns:
- A stream of all
VirtualAccounts.
-
virtualAccounts
Collection<VirtualAccount> virtualAccounts()Gets aCollectionof all availableVirtualAccounts.- Returns:
- A Collection of all
VirtualAccounts.
-
deleteAccount
Deletes the account for the user with the specifiedUUID.Deletion might fail if the provided
UUIDdoes not correspond to an actual player, or for some other implementation-defined reason.- Parameters:
uuid- TheUUIDof the account to delete.- Returns:
- The result of the deletion.
-
deleteAccount
Deletes the account with the specified identifier.If an account exists with the specified identifier, it will be deleted.
Deletion may fail for an implementation-defined reason.
- Parameters:
identifier- The identifier of the account to delete.- Returns:
- The result of the deletion.
-