java.lang.Object
nl.mtvehicles.core.infrastructure.dependencies.VaultUtils

public class VaultUtils extends Object
Methods for Vault soft-dependency.
Beware!
Do not initialise this class directly. Use DependencyModule.vault instead.
  • Constructor Details

    • VaultUtils

      public VaultUtils()
      Default constructor which sets up Vault-linked economy plugin - do not use this.
      Use DependencyModule.vault instead.
  • Method Details

    • isEconomySetUp

      public boolean isEconomySetUp()
      Check whether an economy plugin is linked.
      Returns:
      True if an economy plugin is set up and linked.
    • getEconomyName

      public String getEconomyName()
      Get name of the economy plugin.
    • depositMoneyPlayer

      public boolean depositMoneyPlayer(org.bukkit.OfflinePlayer p, double amount)
      Deposit money into player's account
      Parameters:
      p - Player
      amount - Amount of money
      Returns:
      True if the withdrawal was successful, otherwise false (usually due to an unexpected error).
    • withdrawMoneyPlayer

      public boolean withdrawMoneyPlayer(org.bukkit.OfflinePlayer p, double amount)
      Remove/Withdraw money from player's account
      Parameters:
      p - Player
      amount - Amount of money
      Returns:
      True if the withdrawal was successful, otherwise false (usually due to insufficient funds).
    • getMoneyFormat

      public String getMoneyFormat(double amount)
      Get an amount of money in a string format (e.g. 23.8901 -> '$23,89'). This uses format specified by your economy plugin.
      Parameters:
      amount - Amount of money