Package net.lewmc.essence.utils.economy
Class VaultEconomy
java.lang.Object
net.lewmc.essence.utils.economy.VaultEconomy
- All Implemented Interfaces:
net.milkbowl.vault.economy.Economy
An implementation of the Vault economy interface.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnet.milkbowl.vault.economy.EconomyResponse
Gets a bank balance.net.milkbowl.vault.economy.EconomyResponse
bankDeposit
(String s, double v) Deposits money into a player's bank account.net.milkbowl.vault.economy.EconomyResponse
Checks if a bank has the required amount of funds.net.milkbowl.vault.economy.EconomyResponse
Returns a new EconomyResponse that informs the system that bank accounts are not implemented.net.milkbowl.vault.economy.EconomyResponse
bankWithdraw
(String s, double v) Withdraws money from a player's bank account.net.milkbowl.vault.economy.EconomyResponse
createBank
(String s, String s1) Creates a bank account.net.milkbowl.vault.economy.EconomyResponse
createBank
(String s, org.bukkit.OfflinePlayer offlinePlayer) Creates a bank account.boolean
Creates a new player account.boolean
createPlayerAccount
(String s, String s1) Creates a new player account.boolean
createPlayerAccount
(org.bukkit.OfflinePlayer offlinePlayer) Creates a new player account.boolean
createPlayerAccount
(org.bukkit.OfflinePlayer offlinePlayer, String s) Creates a new player account.Gets the plural currency name.Gets the singular currency name.net.milkbowl.vault.economy.EconomyResponse
deleteBank
(String s) Deletes a bank account.net.milkbowl.vault.economy.EconomyResponse
depositPlayer
(String s, double v) Deposits money into a player's account.net.milkbowl.vault.economy.EconomyResponse
depositPlayer
(String s, String s1, double v) Deposits money into a player's account.net.milkbowl.vault.economy.EconomyResponse
depositPlayer
(org.bukkit.OfflinePlayer offlinePlayer, double v) Deposits money into a player's account.net.milkbowl.vault.economy.EconomyResponse
depositPlayer
(org.bukkit.OfflinePlayer offlinePlayer, String s, double v) Deposits money into a player's account.format
(double v) Formats the amount into an Essence economy string.int
double
getBalance
(String s) Gets the balance of the player.double
getBalance
(String s, String s1) Gets the balance of the player.double
getBalance
(org.bukkit.OfflinePlayer offlinePlayer) Gets the balance of the player.double
getBalance
(org.bukkit.OfflinePlayer offlinePlayer, String s) Gets the balance of the player.getBanks()
Gets a list of banks.getName()
Returns Essence's economy name.boolean
Checks if a player has enough money.boolean
Checks if a player has enough money.boolean
has
(org.bukkit.OfflinePlayer offlinePlayer, double v) Checks if a player has enough money.boolean
Checks if a player has enough money.boolean
hasAccount
(String s) Checks if a player has an account.boolean
hasAccount
(String s, String s1) Checks if a player has an account.boolean
hasAccount
(org.bukkit.OfflinePlayer offlinePlayer) Checks if a player has an account.boolean
hasAccount
(org.bukkit.OfflinePlayer offlinePlayer, String s) Checks if a player has an account.boolean
If Essence supports banks.net.milkbowl.vault.economy.EconomyResponse
isBankMember
(String s, String s1) Checks if a player is a bank member (Not implemented)net.milkbowl.vault.economy.EconomyResponse
isBankMember
(String s, org.bukkit.OfflinePlayer offlinePlayer) Checks if a player is a bank member (Not implemented)net.milkbowl.vault.economy.EconomyResponse
isBankOwner
(String s, String s1) Checks if a player is a bank owner (Not implemented)net.milkbowl.vault.economy.EconomyResponse
isBankOwner
(String s, org.bukkit.OfflinePlayer offlinePlayer) Checks if a player is a bank owner (Not implemented)boolean
Checks if the economy is enabled.net.milkbowl.vault.economy.EconomyResponse
withdrawPlayer
(String s, double v) Withdraws money from a player's account.net.milkbowl.vault.economy.EconomyResponse
withdrawPlayer
(String s, String s1, double v) Withdraws money from a player's account.net.milkbowl.vault.economy.EconomyResponse
withdrawPlayer
(org.bukkit.OfflinePlayer offlinePlayer, double v) Withdraws money from a player's account.net.milkbowl.vault.economy.EconomyResponse
withdrawPlayer
(org.bukkit.OfflinePlayer offlinePlayer, String s, double v) Withdraws money from a player's account.
-
Constructor Details
-
VaultEconomy
Constructor for the VaultEconomy class.- Parameters:
plugin
- Essence - Reference to the main plugin class.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Checks if the economy is enabled.- Specified by:
isEnabled
in interfacenet.milkbowl.vault.economy.Economy
- Returns:
- true - If it's here it's enabled!
-
getName
Returns Essence's economy name.- Specified by:
getName
in interfacenet.milkbowl.vault.economy.Economy
- Returns:
- String - The economy name.
-
hasBankSupport
public boolean hasBankSupport()If Essence supports banks.- Specified by:
hasBankSupport
in interfacenet.milkbowl.vault.economy.Economy
- Returns:
- false - It doesn't
-
fractionalDigits
public int fractionalDigits()- Specified by:
fractionalDigits
in interfacenet.milkbowl.vault.economy.Economy
-
format
Formats the amount into an Essence economy string.- Specified by:
format
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
v
- Double - The amount to format.- Returns:
- String - A formatted string.
-
currencyNamePlural
Gets the plural currency name.- Specified by:
currencyNamePlural
in interfacenet.milkbowl.vault.economy.Economy
- Returns:
- String - The plural currency name.
-
currencyNameSingular
Gets the singular currency name.- Specified by:
currencyNameSingular
in interfacenet.milkbowl.vault.economy.Economy
- Returns:
- String - The singular currency name.
-
hasAccount
Checks if a player has an account.- Specified by:
hasAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player name.- Returns:
- boolean - If the player has an account.
-
hasAccount
public boolean hasAccount(org.bukkit.OfflinePlayer offlinePlayer) Checks if a player has an account.- Specified by:
hasAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- String - The player (type of offlinePlayer).- Returns:
- boolean - If the player has an account.
-
hasAccount
Checks if a player has an account.- Specified by:
hasAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player name.- Returns:
- boolean - If the player has an account.
-
hasAccount
Checks if a player has an account.- Specified by:
hasAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- String - The player (type of offlinePlayer).- Returns:
- boolean - If the player has an account.
-
getBalance
Gets the balance of the player.- Specified by:
getBalance
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to check.- Returns:
- double - The player's balance.
-
getBalance
public double getBalance(org.bukkit.OfflinePlayer offlinePlayer) Gets the balance of the player.- Specified by:
getBalance
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to check.- Returns:
- double - The player's balance.
-
getBalance
Gets the balance of the player.- Specified by:
getBalance
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to check.s1
- String - Not implemented.- Returns:
- double - The player's balance.
-
getBalance
Gets the balance of the player.- Specified by:
getBalance
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to check.s
- String - Not implemented.- Returns:
- double - The player's balance.
-
has
Checks if a player has enough money.- Specified by:
has
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to check.v
- double - The amount to check for.- Returns:
- boolean - The result of the operation.
-
has
public boolean has(org.bukkit.OfflinePlayer offlinePlayer, double v) Checks if a player has enough money.- Specified by:
has
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to check.v
- double - The amount to check for.- Returns:
- boolean - The result of the operation.
-
has
Checks if a player has enough money.- Specified by:
has
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to check.s1
- String - Not implemented.v
- double - The amount to check for.- Returns:
- boolean - The result of the operation.
-
has
Checks if a player has enough money.- Specified by:
has
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to check.s
- String - Not implemented.v
- double - The amount to check for.- Returns:
- boolean - The result of the operation.
-
withdrawPlayer
Withdraws money from a player's account.- Specified by:
withdrawPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to withdraw money from.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
withdrawPlayer
public net.milkbowl.vault.economy.EconomyResponse withdrawPlayer(org.bukkit.OfflinePlayer offlinePlayer, double v) Withdraws money from a player's account.- Specified by:
withdrawPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to withdraw money from.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
withdrawPlayer
Withdraws money from a player's account.- Specified by:
withdrawPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to withdraw money from.s1
- String - Not implemented.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
withdrawPlayer
public net.milkbowl.vault.economy.EconomyResponse withdrawPlayer(org.bukkit.OfflinePlayer offlinePlayer, String s, double v) Withdraws money from a player's account.- Specified by:
withdrawPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to withdraw money from.s
- String - Not implemented.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
depositPlayer
Deposits money into a player's account.- Specified by:
depositPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to deposit money to.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
depositPlayer
public net.milkbowl.vault.economy.EconomyResponse depositPlayer(org.bukkit.OfflinePlayer offlinePlayer, double v) Deposits money into a player's account.- Specified by:
depositPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to deposit money to.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
depositPlayer
Deposits money into a player's account.- Specified by:
depositPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to deposit money to.s1
- String - Not implemented.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
depositPlayer
public net.milkbowl.vault.economy.EconomyResponse depositPlayer(org.bukkit.OfflinePlayer offlinePlayer, String s, double v) Deposits money into a player's account.- Specified by:
depositPlayer
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to deposit money to.s
- String - Not implemented.v
- double - Amount- Returns:
- EconomyResponse - The result of the operation.
-
createBank
Creates a bank account. (Not implemented)- Specified by:
createBank
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.s1
- String - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
createBank
public net.milkbowl.vault.economy.EconomyResponse createBank(String s, org.bukkit.OfflinePlayer offlinePlayer) Creates a bank account. (Not implemented)- Specified by:
createBank
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.offlinePlayer
- OfflinePlayer - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
deleteBank
Deletes a bank account. (Not implemented)- Specified by:
deleteBank
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.- Returns:
- EconomyResponse - Fails (not implemented)
-
bankBalance
Gets a bank balance. (Not implemented)- Specified by:
bankBalance
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.- Returns:
- EconomyResponse - Fails (not implemented)
-
bankHas
Checks if a bank has the required amount of funds. (Not implemented)- Specified by:
bankHas
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.v
- double - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
bankWithdraw
Withdraws money from a player's bank account. (Not implemented)- Specified by:
bankWithdraw
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.v
- double - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
bankDeposit
Deposits money into a player's bank account. (Not implemented)- Specified by:
bankDeposit
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.v
- double - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
isBankOwner
Checks if a player is a bank owner (Not implemented)- Specified by:
isBankOwner
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.s1
- String - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
isBankOwner
public net.milkbowl.vault.economy.EconomyResponse isBankOwner(String s, org.bukkit.OfflinePlayer offlinePlayer) Checks if a player is a bank owner (Not implemented)- Specified by:
isBankOwner
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.offlinePlayer
- OfflinePlayer - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
isBankMember
Checks if a player is a bank member (Not implemented)- Specified by:
isBankMember
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.s1
- String - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
isBankMember
public net.milkbowl.vault.economy.EconomyResponse isBankMember(String s, org.bukkit.OfflinePlayer offlinePlayer) Checks if a player is a bank member (Not implemented)- Specified by:
isBankMember
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - Not implemented.offlinePlayer
- OfflinePlayer - Not implemented- Returns:
- EconomyResponse - Fails (not implemented)
-
getBanks
Gets a list of banks. (Not implemented)- Specified by:
getBanks
in interfacenet.milkbowl.vault.economy.Economy
- Returns:
- List - Returns an empty list (Not implemented)
-
createPlayerAccount
Creates a new player account.- Specified by:
createPlayerAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to create an account for.- Returns:
- boolean - If the operation was successful.
-
createPlayerAccount
public boolean createPlayerAccount(org.bukkit.OfflinePlayer offlinePlayer) Creates a new player account.- Specified by:
createPlayerAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to create an account for.- Returns:
- boolean - If the operation was successful.
-
createPlayerAccount
Creates a new player account.- Specified by:
createPlayerAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
s
- String - The player to create an account for.s1
- String - Unused (not implemented)- Returns:
- boolean - If the operation was successful.
-
createPlayerAccount
Creates a new player account.- Specified by:
createPlayerAccount
in interfacenet.milkbowl.vault.economy.Economy
- Parameters:
offlinePlayer
- OfflinePlayer - The player to create an account for.s
- String - Unused (not implemented)- Returns:
- boolean - If the operation was successful.
-
bankNotImplemented
public net.milkbowl.vault.economy.EconomyResponse bankNotImplemented()Returns a new EconomyResponse that informs the system that bank accounts are not implemented.- Returns:
- EconomyResponse - Preset value stating that bank accounts are not implemented.
-