public interface Economy
| Modifier and Type | Method and Description |
|---|---|
EconomyResponse |
bankBalance(String name)
Returns the amount the bank has
|
EconomyResponse |
bankDeposit(String name,
double amount)
Deposit an amount into a bank account - DO NOT USE NEGATIVE AMOUNTS
|
EconomyResponse |
bankHas(String name,
double amount)
Returns true or false whether the bank has the amount specified - DO NOT USE NEGATIVE AMOUNTS
|
EconomyResponse |
bankWithdraw(String name,
double amount)
Withdraw an amount from a bank account - DO NOT USE NEGATIVE AMOUNTS
|
EconomyResponse |
createBank(String name,
String player)
Creates a bank account with the specified name and the player as the owner
|
boolean |
createPlayerAccount(String playerName)
Attempts to create a player account for the given player
|
boolean |
createPlayerAccount(String playerName,
String worldName)
Attempts to create a player account for the given player on the specified world
IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
|
String |
currencyNamePlural()
Returns the name of the currency in plural form.
|
String |
currencyNameSingular()
Returns the name of the currency in singular form.
|
EconomyResponse |
deleteBank(String name)
Deletes a bank account with the specified name.
|
EconomyResponse |
depositPlayer(String playerName,
double amount)
Deposit an amount to a player - DO NOT USE NEGATIVE AMOUNTS
|
EconomyResponse |
depositPlayer(String playerName,
String worldName,
double amount)
Deposit an amount to a player - DO NOT USE NEGATIVE AMOUNTS
IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
|
String |
format(double amount)
Format amount into a human readable String This provides translation into
economy specific formatting to improve consistency between plugins.
|
int |
fractionalDigits()
Some economy plugins round off after a certain number of digits.
|
double |
getBalance(String playerName)
Gets balance of a player
|
double |
getBalance(String playerName,
String world)
Gets balance of a player on the specified world.
|
List<String> |
getBanks()
Gets the list of banks
|
String |
getName()
Gets name of economy method
|
boolean |
has(String playerName,
double amount)
Checks if the player account has the amount - DO NOT USE NEGATIVE AMOUNTS
|
boolean |
has(String playerName,
String worldName,
double amount)
Checks if the player account has the amount in a given world - DO NOT USE NEGATIVE AMOUNTS
IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
|
boolean |
hasAccount(String playerName)
Checks if this player has an account on the server yet
This will always return true if the player has joined the server at least once
as all major economy plugins auto-generate a player account when the player joins the server
|
boolean |
hasAccount(String playerName,
String worldName)
Checks if this player has an account on the server yet on the given world
This will always return true if the player has joined the server at least once
as all major economy plugins auto-generate a player account when the player joins the server
|
boolean |
hasBankSupport()
Returns true if the given implementation supports banks.
|
EconomyResponse |
isBankMember(String name,
String playerName)
Check if the player is a member of the bank account
|
EconomyResponse |
isBankOwner(String name,
String playerName)
Check if a player is the owner of a bank account
|
boolean |
isEnabled()
Checks if economy method is enabled.
|
EconomyResponse |
withdrawPlayer(String playerName,
double amount)
Withdraw an amount from a player - DO NOT USE NEGATIVE AMOUNTS
|
EconomyResponse |
withdrawPlayer(String playerName,
String worldName,
double amount)
Withdraw an amount from a player on a given world - DO NOT USE NEGATIVE AMOUNTS
IMPLEMENTATION SPECIFIC - if an economy plugin does not support this the global balance will be returned.
|
boolean isEnabled()
boolean hasBankSupport()
int fractionalDigits()
String format(double amount)
amount - to formatString currencyNamePlural()
String currencyNameSingular()
boolean hasAccount(String playerName)
playerName - to checkboolean hasAccount(String playerName, String worldName)
playerName - to check in the worldworldName - world-specific accountdouble getBalance(String playerName)
playerName - of the playerdouble getBalance(String playerName, String world)
playerName - world - name of the worldboolean has(String playerName, double amount)
playerName - to checkamount - to check forboolean has(String playerName, String worldName, double amount)
playerName - to checkworldName - to check withamount - to check forEconomyResponse withdrawPlayer(String playerName, double amount)
playerName - Name of playeramount - Amount to withdrawEconomyResponse withdrawPlayer(String playerName, String worldName, double amount)
playerName - Name of playerworldName - - name of the worldamount - Amount to withdrawEconomyResponse depositPlayer(String playerName, double amount)
playerName - Name of playeramount - Amount to depositEconomyResponse depositPlayer(String playerName, String worldName, double amount)
playerName - Name of playeramount - Amount to depositEconomyResponse createBank(String name, String player)
name - of accountplayer - the account should be linked toEconomyResponse deleteBank(String name)
name - of the back to deleteEconomyResponse bankBalance(String name)
name - of the accountEconomyResponse bankHas(String name, double amount)
name - of the accountamount - to check forEconomyResponse bankWithdraw(String name, double amount)
name - of the accountamount - to withdrawEconomyResponse bankDeposit(String name, double amount)
name - of the accountamount - to depositEconomyResponse isBankOwner(String name, String playerName)
name - of the accountplayerName - to check for ownershipEconomyResponse isBankMember(String name, String playerName)
name - of the accountplayerName - to check membershipboolean createPlayerAccount(String playerName)
boolean createPlayerAccount(String playerName, String worldName)
Milkbowl, 2014