Package valorless.havenbags.hooks
Class Eco
java.lang.Object
valorless.havenbags.hooks.Eco
Minimal wrapper around the active Vault economy provider.
This utility centralizes balance checks and withdrawals used by HavenBags features.
The provider instance is resolved through VaultHook.getEconomy() during
init() and then reused by the static helper methods in this class.
Call init() once during plugin startup before using
canAfford(UUID, double) or takeMoney(UUID, double).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanChecks whether a player has enough balance for a charge.static doublegetBalance(UUID player) Gets the current balance of a player.static voidDeposits funds to a player's account.static voidinit()Initializes the cached Vault economy provider.static voidWithdraws funds from a player's account.
-
Constructor Details
-
Eco
public Eco()
-
-
Method Details
-
init
public static void init()Initializes the cached Vault economy provider. -
canAfford
Checks whether a player has enough balance for a charge.- Parameters:
player- the UUID of the player to checkprice- the amount that would be charged- Returns:
truewhen the player balance is greater than or equal toprice
-
getBalance
Gets the current balance of a player.- Parameters:
player- the UUID of the player to check- Returns:
- the player's current balance
-
takeMoney
Withdraws funds from a player's account.- Parameters:
player- the UUID of the player to chargeamount- the amount to withdraw
-
giveMoney
Deposits funds to a player's account.- Parameters:
player- the UUID of the player to giveamount- the amount to deposit
-