Class VaultUtils
java.lang.Object
nl.mtvehicles.core.infrastructure.dependencies.VaultUtils
Methods for Vault soft-dependency.
- Beware!
- Do not initialise this class directly. Use
DependencyModule.vault
instead.
-
Constructor Summary
ConstructorDescriptionDefault constructor which sets up Vault-linked economy plugin - do not use this.
UseDependencyModule.vault
instead. -
Method Summary
Modifier and TypeMethodDescriptionboolean
depositMoneyPlayer(org.bukkit.OfflinePlayer p, double amount)
Deposit money into player's accountGet name of the economy plugin.getMoneyFormat(double amount)
Get an amount of money in a string format (e.g.boolean
Check whether an economy plugin is linked.boolean
withdrawMoneyPlayer(org.bukkit.OfflinePlayer p, double amount)
Remove/Withdraw money from player's account
-
Constructor Details
-
VaultUtils
public VaultUtils()Default constructor which sets up Vault-linked economy plugin - do not use this.
UseDependencyModule.vault
instead.
-
-
Method Details
-
isEconomySetUp
public boolean isEconomySetUp()Check whether an economy plugin is linked.- Returns:
- True if an economy plugin is set up and linked.
-
getEconomyName
Get name of the economy plugin. -
depositMoneyPlayer
public boolean depositMoneyPlayer(org.bukkit.OfflinePlayer p, double amount)Deposit money into player's account- Parameters:
p
- Playeramount
- Amount of money- Returns:
- True if the withdrawal was successful, otherwise false (usually due to an unexpected error).
-
withdrawMoneyPlayer
public boolean withdrawMoneyPlayer(org.bukkit.OfflinePlayer p, double amount)Remove/Withdraw money from player's account- Parameters:
p
- Playeramount
- Amount of money- Returns:
- True if the withdrawal was successful, otherwise false (usually due to insufficient funds).
-
getMoneyFormat
Get an amount of money in a string format (e.g. 23.8901 -> '$23,89'). This uses format specified by your economy plugin.- Parameters:
amount
- Amount of money
-