Interface EconomyService
public interface EconomyService
YouNeedMe's internal economy. This is also exposed to the rest of the server through a
net.milkbowl.vault.economy.Economy provider (see core's Vault integration), so any other
plugin can transact against it without knowing YouNeedMe exists - use this interface directly
only when you need YouNeedMe-specific features Vault's API doesn't have, such as multi-currency
support or transferAtomic(UUID, UUID, String, double).
Every mutating call is serialized per-player internally (a spam of /pay cannot cause a
double-spend), and every method is safe to call from any thread.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<Double> default CompletableFuture<EconomyResult> default CompletableFuture<EconomyResult> setBalance(UUID player, double amount) setBalance(UUID player, String currencyId, double amount) Top balances for/baltop, richest first.default CompletableFuture<EconomyResult> transferAtomic(UUID from, UUID to, double amount) transferAtomic(UUID from, UUID to, String currencyId, double amount) Withdraws fromfromand deposits totoas a single atomic unit: on insufficient funds neither balance changes.default CompletableFuture<EconomyResult>
-
Field Details
-
DEFAULT_CURRENCY
- See Also:
-
-
Method Details
-
currencies
-
currency
-
balance
-
balance
-
has
-
deposit
-
withdraw
-
setBalance
-
deposit
-
withdraw
-
setBalance
-
transferAtomic
CompletableFuture<EconomyResult> transferAtomic(UUID from, UUID to, String currencyId, double amount) Withdraws fromfromand deposits totoas a single atomic unit: on insufficient funds neither balance changes. This is what/payuses, and is the right primitive for any plugin-to-plugin transfer. -
transferAtomic
-
top
Top balances for/baltop, richest first.
-