java.lang.Object
us.teaminceptus.novaconomy.api.bank.Bank

public final class Bank extends Object
Represents the Global Bank in Novaconomy that holds tax money in the server.
  • Method Details

    • reloadBank

      public static void reloadBank()
      Clears the Bank's cached values and reads the newly fresh values.
    • getBalances

      @NotNull public static @NotNull Map<Economy,Double> 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

      public static void setBalances(@NotNull @NotNull Map<Economy,Double> amounts)
      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

      public static void addBalance(@NotNull @NotNull Price price) throws IllegalArgumentException
      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

      public static void removeBalance(@NotNull @NotNull Price price) throws IllegalArgumentException
      Removes a Price from the Bank.
      Parameters:
      price - Price to remove
      Throws:
      IllegalArgumentException - if price is null
    • getBalance

      public static double getBalance(@NotNull @NotNull Economy econ)
      Fetches the Bank Balance of this Economy.
      Parameters:
      econ - Economy to fetch the balance of
      Returns:
      Bank Balance, or 0 if economy is null