Package org.yuemi.libs.api.economy
Interface EconomyProvider
public interface EconomyProvider
Represents a specific economy backend (e.g. Vault, PlayerPoints, custom, etc.).
-
Method Summary
Modifier and TypeMethodDescriptionbooleandeposit(@NotNull org.bukkit.OfflinePlayer player, double amount) Deposits an amount into a player's balance.doublegetBalance(@NotNull org.bukkit.OfflinePlayer player) Gets the balance of a player.@NotNull StringgetName()Gets the unique name of this provider.booleanChecks if this economy provider is available and ready for transactions.booleansetBalance(@NotNull org.bukkit.OfflinePlayer player, double amount) Sets a player's balance to a specific amount.booleanwithdraw(@NotNull org.bukkit.OfflinePlayer player, double amount) Withdraws an amount from a player's balance.
-
Method Details
-
getName
Gets the unique name of this provider.- Returns:
- the provider name
-
isAvailable
boolean isAvailable()Checks if this economy provider is available and ready for transactions.- Returns:
- true if available, false otherwise
-
getBalance
double getBalance(@NotNull @NotNull org.bukkit.OfflinePlayer player) Gets the balance of a player.- Parameters:
player- the player- Returns:
- the balance, or 0.0 if not available or player has no account
-
withdraw
boolean withdraw(@NotNull @NotNull org.bukkit.OfflinePlayer player, double amount) Withdraws an amount from a player's balance.- Parameters:
player- the playeramount- the amount to withdraw- Returns:
- true if successful, false otherwise
-
deposit
boolean deposit(@NotNull @NotNull org.bukkit.OfflinePlayer player, double amount) Deposits an amount into a player's balance.- Parameters:
player- the playeramount- the amount to deposit- Returns:
- true if successful, false otherwise
-
setBalance
boolean setBalance(@NotNull @NotNull org.bukkit.OfflinePlayer player, double amount) Sets a player's balance to a specific amount.- Parameters:
player- the playeramount- the new balance amount- Returns:
- true if successful, false otherwise
-