Class Bank
java.lang.Object
us.teaminceptus.novaconomy.api.bank.Bank
Represents the Global Bank in Novaconomy that holds tax money in the server.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBalance(@NotNull Economy econ, double amount) Adds a balance to the Bank.static voidaddBalance(@NotNull Price price) Adds a Price to the Bank.static doublegetBalance(@NotNull Economy econ) Fetches the Bank Balance of this Economy.Fetches all of the balances in the Bank.static voidClears the Bank's cached values and reads the newly fresh values.static voidremoveBalance(@NotNull Economy econ, double amount) Removes a balance from the Bank.static voidremoveBalance(@NotNull Price price) Removes a Price from the Bank.static voidsetBalance(@NotNull Economy econ, double amount) Sets the Bank Balance of this Economy.static voidsetBalances(@NotNull Map<Economy, Double> amounts) Sets a set of balances in the Bank.
-
Method Details
-
reloadBank
public static void reloadBank()Clears the Bank's cached values and reads the newly fresh values. -
getBalances
Fetches all of the balances in the Bank.- Returns:
- Map of all of the balances in the Bank to their values.
-
setBalance
public static void setBalance(@NotNull @NotNull Economy econ, double amount) throws IllegalArgumentException Sets the Bank Balance of this Economy.- Parameters:
econ- Economy to set the balance of.amount- Amount to set the balance to.- Throws:
IllegalArgumentException- if econ is null
-
setBalances
Sets a set of balances in the Bank.- Parameters:
amounts- Map of Economies to their amounts.
-
addBalance
public static void addBalance(@NotNull @NotNull Economy econ, double amount) throws IllegalArgumentException Adds a balance to the Bank.- Parameters:
econ- Economy to add the balance to.amount- Amount to add to the balance.- Throws:
IllegalArgumentException- if economy is null
-
addBalance
Adds a Price to the Bank.- Parameters:
price- Price to add- Throws:
IllegalArgumentException- if price is null
-
removeBalance
public static void removeBalance(@NotNull @NotNull Economy econ, double amount) throws IllegalArgumentException Removes a balance from the Bank.- Parameters:
econ- Economy to remove the balance from.amount- Amount to remove from the balance.- Throws:
IllegalArgumentException- if economy is null
-
removeBalance
Removes a Price from the Bank.- Parameters:
price- Price to remove- Throws:
IllegalArgumentException- if price is null
-
getBalance
Fetches the Bank Balance of this Economy.- Parameters:
econ- Economy to fetch the balance of- Returns:
- Bank Balance, or 0 if economy is null
-