Class VaultEconomy

java.lang.Object
net.lewmc.essence.utils.economy.VaultEconomy
All Implemented Interfaces:
net.milkbowl.vault.economy.Economy

public class VaultEconomy extends Object implements net.milkbowl.vault.economy.Economy
An implementation of the Vault economy interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the VaultEconomy class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.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
    bankHas(String s, double v)
    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
    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
    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
    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
    Gets the balance of the player.
    double
    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.
    Gets a list of banks.
    Returns Essence's economy name.
    boolean
    has(String s, double v)
    Checks if a player has enough money.
    boolean
    has(String s, String s1, double v)
    Checks if a player has enough money.
    boolean
    has(org.bukkit.OfflinePlayer offlinePlayer, double v)
    Checks if a player has enough money.
    boolean
    has(org.bukkit.OfflinePlayer offlinePlayer, String s, double v)
    Checks if a player has enough money.
    boolean
    Checks if a player has an account.
    boolean
    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
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VaultEconomy

      public VaultEconomy(Essence plugin)
      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 interface net.milkbowl.vault.economy.Economy
      Returns:
      true - If it's here it's enabled!
    • getName

      public String getName()
      Returns Essence's economy name.
      Specified by:
      getName in interface net.milkbowl.vault.economy.Economy
      Returns:
      String - The economy name.
    • hasBankSupport

      public boolean hasBankSupport()
      If Essence supports banks.
      Specified by:
      hasBankSupport in interface net.milkbowl.vault.economy.Economy
      Returns:
      false - It doesn't
    • fractionalDigits

      public int fractionalDigits()
      Specified by:
      fractionalDigits in interface net.milkbowl.vault.economy.Economy
    • format

      public String format(double v)
      Formats the amount into an Essence economy string.
      Specified by:
      format in interface net.milkbowl.vault.economy.Economy
      Parameters:
      v - Double - The amount to format.
      Returns:
      String - A formatted string.
    • currencyNamePlural

      public String currencyNamePlural()
      Gets the plural currency name.
      Specified by:
      currencyNamePlural in interface net.milkbowl.vault.economy.Economy
      Returns:
      String - The plural currency name.
    • currencyNameSingular

      public String currencyNameSingular()
      Gets the singular currency name.
      Specified by:
      currencyNameSingular in interface net.milkbowl.vault.economy.Economy
      Returns:
      String - The singular currency name.
    • hasAccount

      public boolean hasAccount(String s)
      Checks if a player has an account.
      Specified by:
      hasAccount in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - String - The player (type of offlinePlayer).
      Returns:
      boolean - If the player has an account.
    • hasAccount

      public boolean hasAccount(String s, String s1)
      Checks if a player has an account.
      Specified by:
      hasAccount in interface net.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, String s)
      Checks if a player has an account.
      Specified by:
      hasAccount in interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - String - The player (type of offlinePlayer).
      Returns:
      boolean - If the player has an account.
    • getBalance

      public double getBalance(String s)
      Gets the balance of the player.
      Specified by:
      getBalance in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - OfflinePlayer - The player to check.
      Returns:
      double - The player's balance.
    • getBalance

      public double getBalance(String s, String s1)
      Gets the balance of the player.
      Specified by:
      getBalance in interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - The player to check.
      s1 - String - Not implemented.
      Returns:
      double - The player's balance.
    • getBalance

      public double getBalance(org.bukkit.OfflinePlayer offlinePlayer, String s)
      Gets the balance of the player.
      Specified by:
      getBalance in interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - OfflinePlayer - The player to check.
      s - String - Not implemented.
      Returns:
      double - The player's balance.
    • has

      public boolean has(String s, double v)
      Checks if a player has enough money.
      Specified by:
      has in interface net.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 interface net.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

      public boolean has(String s, String s1, double v)
      Checks if a player has enough money.
      Specified by:
      has in interface net.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

      public boolean has(org.bukkit.OfflinePlayer offlinePlayer, String s, double v)
      Checks if a player has enough money.
      Specified by:
      has in interface net.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

      public net.milkbowl.vault.economy.EconomyResponse withdrawPlayer(String s, double v)
      Withdraws money from a player's account.
      Specified by:
      withdrawPlayer in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - OfflinePlayer - The player to withdraw money from.
      v - double - Amount
      Returns:
      EconomyResponse - The result of the operation.
    • withdrawPlayer

      public net.milkbowl.vault.economy.EconomyResponse withdrawPlayer(String s, String s1, double v)
      Withdraws money from a player's account.
      Specified by:
      withdrawPlayer in interface net.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 interface net.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

      public net.milkbowl.vault.economy.EconomyResponse depositPlayer(String s, double v)
      Deposits money into a player's account.
      Specified by:
      depositPlayer in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - OfflinePlayer - The player to deposit money to.
      v - double - Amount
      Returns:
      EconomyResponse - The result of the operation.
    • depositPlayer

      public net.milkbowl.vault.economy.EconomyResponse depositPlayer(String s, String s1, double v)
      Deposits money into a player's account.
      Specified by:
      depositPlayer in interface net.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 interface net.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

      public net.milkbowl.vault.economy.EconomyResponse createBank(String s, String s1)
      Creates a bank account. (Not implemented)
      Specified by:
      createBank in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      offlinePlayer - OfflinePlayer - Not implemented
      Returns:
      EconomyResponse - Fails (not implemented)
    • deleteBank

      public net.milkbowl.vault.economy.EconomyResponse deleteBank(String s)
      Deletes a bank account. (Not implemented)
      Specified by:
      deleteBank in interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      Returns:
      EconomyResponse - Fails (not implemented)
    • bankBalance

      public net.milkbowl.vault.economy.EconomyResponse bankBalance(String s)
      Gets a bank balance. (Not implemented)
      Specified by:
      bankBalance in interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      Returns:
      EconomyResponse - Fails (not implemented)
    • bankHas

      public net.milkbowl.vault.economy.EconomyResponse bankHas(String s, double v)
      Checks if a bank has the required amount of funds. (Not implemented)
      Specified by:
      bankHas in interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      v - double - Not implemented
      Returns:
      EconomyResponse - Fails (not implemented)
    • bankWithdraw

      public net.milkbowl.vault.economy.EconomyResponse bankWithdraw(String s, double v)
      Withdraws money from a player's bank account. (Not implemented)
      Specified by:
      bankWithdraw in interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      v - double - Not implemented
      Returns:
      EconomyResponse - Fails (not implemented)
    • bankDeposit

      public net.milkbowl.vault.economy.EconomyResponse bankDeposit(String s, double v)
      Deposits money into a player's bank account. (Not implemented)
      Specified by:
      bankDeposit in interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      v - double - Not implemented
      Returns:
      EconomyResponse - Fails (not implemented)
    • isBankOwner

      public net.milkbowl.vault.economy.EconomyResponse isBankOwner(String s, String s1)
      Checks if a player is a bank owner (Not implemented)
      Specified by:
      isBankOwner in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      offlinePlayer - OfflinePlayer - Not implemented
      Returns:
      EconomyResponse - Fails (not implemented)
    • isBankMember

      public net.milkbowl.vault.economy.EconomyResponse isBankMember(String s, String s1)
      Checks if a player is a bank member (Not implemented)
      Specified by:
      isBankMember in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      s - String - Not implemented.
      offlinePlayer - OfflinePlayer - Not implemented
      Returns:
      EconomyResponse - Fails (not implemented)
    • getBanks

      public List<String> getBanks()
      Gets a list of banks. (Not implemented)
      Specified by:
      getBanks in interface net.milkbowl.vault.economy.Economy
      Returns:
      List - Returns an empty list (Not implemented)
    • createPlayerAccount

      public boolean createPlayerAccount(String s)
      Creates a new player account.
      Specified by:
      createPlayerAccount in interface net.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 interface net.milkbowl.vault.economy.Economy
      Parameters:
      offlinePlayer - OfflinePlayer - The player to create an account for.
      Returns:
      boolean - If the operation was successful.
    • createPlayerAccount

      public boolean createPlayerAccount(String s, String s1)
      Creates a new player account.
      Specified by:
      createPlayerAccount in interface net.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

      public boolean createPlayerAccount(org.bukkit.OfflinePlayer offlinePlayer, String s)
      Creates a new player account.
      Specified by:
      createPlayerAccount in interface net.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.