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 defaultCurrency
used 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 theVirtualAccount
with the specified identifier.findOrCreateAccount
(UUID uuid) Gets theUniqueAccount
for the user with the specifiedUUID
.boolean
hasAccount
(String identifier) Returns whether anAccount
with the specified identifier exists.boolean
hasAccount
(UUID uuid) Returns whether aUniqueAccount
exists with the specifiedUUID
.Gets aStream
of all availableUniqueAccount
s.Gets aStream
of all availableVirtualAccount
s.Gets aCollection
of all availableUniqueAccount
s.Gets aCollection
of all availableVirtualAccount
s.
-
Method Details
-
defaultCurrency
Currency defaultCurrency()Retrieves the defaultCurrency
used by theEconomyService
.- Returns:
Currency
default for the EconomyService- See Also:
-
hasAccount
Returns whether aUniqueAccount
exists with the specifiedUUID
.- Parameters:
uuid
- TheUUID
of the account to check for- Returns:
- Whether a
UniqueAccount
exists with the specifiedUUID
-
hasAccount
Returns whether anAccount
with the specified identifier exists.Depending on the implementation, the
Account
may be aUniqueAccount
or aVirtualAccount
.- Parameters:
identifier
- The identifier of the account to check for- Returns:
- Whether an
Account
with the specified identifier exists
-
findOrCreateAccount
Gets theUniqueAccount
for 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
UUID
does not correspond to an actual player, or for an implementation-defined reason.- Parameters:
uuid
- TheUUID
of the account to get.- Returns:
- The
UniqueAccount
, if available.
-
findOrCreateAccount
Gets theVirtualAccount
with the specified identifier.Depending on the implementation, the
Account
may be aUniqueAccount
or 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 aStream
of all availableUniqueAccount
s.- Returns:
- A stream of all
UniqueAccount
s.
-
uniqueAccounts
Collection<UniqueAccount> uniqueAccounts()Gets aCollection
of all availableUniqueAccount
s.- Returns:
- A Collection of all
UniqueAccount
s.
-
streamVirtualAccounts
Stream<VirtualAccount> streamVirtualAccounts()Gets aStream
of all availableVirtualAccount
s.- Returns:
- A stream of all
VirtualAccount
s.
-
virtualAccounts
Collection<VirtualAccount> virtualAccounts()Gets aCollection
of all availableVirtualAccount
s.- Returns:
- A Collection of all
VirtualAccount
s.
-
deleteAccount
Deletes the account for the user with the specifiedUUID
.Deletion might fail if the provided
UUID
does not correspond to an actual player, or for some other implementation-defined reason.- Parameters:
uuid
- TheUUID
of 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.
-