Package com.ranull.graves.integration
Class Vault
java.lang.Object
com.ranull.graves.integration.Vault
Provides an integration with Vault's economy system to manage player balances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate net.milkbowl.vault.economy.Economy
private net.milkbowl.vault.permission.Permission
-
Constructor Summary
ConstructorsConstructorDescriptionVault
(net.milkbowl.vault.economy.Economy economy) Deprecated.Vault
(net.milkbowl.vault.economy.Economy economy, net.milkbowl.vault.permission.Permission permission) Constructs a new Vault integration instance with the specified Economy instance.Vault
(net.milkbowl.vault.permission.Permission permission) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getBalance
(org.bukkit.OfflinePlayer player) Gets the current balance of a player.boolean
hasBalance
(org.bukkit.OfflinePlayer player) Checks if a player has any balance (greater than or equal to one cent).boolean
hasBalance
(org.bukkit.OfflinePlayer player, double balance) Checks if a player has a balance greater than or equal to the specified amount.boolean
hasPermission
(org.bukkit.OfflinePlayer player, String permissionNode) Checks if a player has the specified permission.boolean
withdrawBalance
(org.bukkit.OfflinePlayer player, double balance) Withdraws a specified amount from a player's balance.
-
Field Details
-
economy
private net.milkbowl.vault.economy.Economy economy -
permission
private net.milkbowl.vault.permission.Permission permission
-
-
Constructor Details
-
Vault
public Vault(net.milkbowl.vault.economy.Economy economy, net.milkbowl.vault.permission.Permission permission) Constructs a new Vault integration instance with the specified Economy instance.- Parameters:
economy
- The Economy instance provided by Vault.permission
- The Permission instance provided by Vault.
-
Vault
Deprecated.Constructs a new Vault integration instance with the specified Economy instance.- Parameters:
economy
- The Economy instance provided by Vault.
-
Vault
Deprecated.Constructs a new Vault integration instance with the specified Economy instance.- Parameters:
permission
- The Permission instance provided by Vault.
-
-
Method Details
-
hasBalance
public boolean hasBalance(org.bukkit.OfflinePlayer player) Checks if a player has any balance (greater than or equal to one cent).- Parameters:
player
- The player to check.- Returns:
true
if the player has a positive balance, otherwisefalse
.
-
hasBalance
public boolean hasBalance(org.bukkit.OfflinePlayer player, double balance) Checks if a player has a balance greater than or equal to the specified amount.- Parameters:
player
- The player whose balance to check.balance
- The amount to check against.- Returns:
true
if the player has a balance greater than or equal to the specified amount, otherwisefalse
.
-
getBalance
public double getBalance(org.bukkit.OfflinePlayer player) Gets the current balance of a player.- Parameters:
player
- The player whose balance to retrieve.- Returns:
- The balance of the player.
-
withdrawBalance
public boolean withdrawBalance(org.bukkit.OfflinePlayer player, double balance) Withdraws a specified amount from a player's balance.- Parameters:
player
- The player from whom the balance will be withdrawn.balance
- The amount to withdraw.- Returns:
true
if the withdrawal was successful, otherwisefalse
.
-
hasPermission
Checks if a player has the specified permission.- Parameters:
player
- The player whose permission to check.permissionNode
- The permission node to check.- Returns:
true
if the player has the specified permission, otherwisefalse
.
-