java.lang.Object
ua.mcchickenstudio.opencreative.managers.economy.VaultEconomy
All Implemented Interfaces:
Economy, Manager, ShutDownable, Startable, Toggleable

public final class VaultEconomy extends Object implements Economy
Implementation of Vault economy, the most used on servers.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    depositMoney(@NotNull org.bukkit.OfflinePlayer offlinePlayer, @NotNull Number money)
    Deposits money to player for some reason, examples: gets world liked, some player bought in his world.
    @NotNull Number
    getBalance(org.bukkit.OfflinePlayer offlinePlayer)
    Returns an amount of money that player has currently on his balance.
    @NotNull String
    Returns name of manager, that will be displayed by request in the logs.
    boolean
    Checks whether manager was started successfully and it currently works.
    void
    Does tasks on shutdown.
    void
    Does tasks on start.
    boolean
    withdrawMoney(@NotNull org.bukkit.OfflinePlayer offlinePlayer, @NotNull Number money)
    Takes money from player balance, examples: buys something in world.

    Methods inherited from class java.lang.Object

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

    • VaultEconomy

      public VaultEconomy()
  • Method Details

    • depositMoney

      public boolean depositMoney(@NotNull @NotNull org.bukkit.OfflinePlayer offlinePlayer, @NotNull @NotNull Number money)
      Description copied from interface: Economy
      Deposits money to player for some reason, examples: gets world liked, some player bought in his world.
      Specified by:
      depositMoney in interface Economy
      Parameters:
      offlinePlayer - Player to give money.
      money - Amount of money to give.
      Returns:
      true - if successfully taken, false - failed.
    • withdrawMoney

      public boolean withdrawMoney(@NotNull @NotNull org.bukkit.OfflinePlayer offlinePlayer, @NotNull @NotNull Number money)
      Description copied from interface: Economy
      Takes money from player balance, examples: buys something in world.
      Specified by:
      withdrawMoney in interface Economy
      Parameters:
      offlinePlayer - Player to take his money.
      money - Amount of money to take.
      Returns:
      true - if successfully taken, false - failed.
    • getBalance

      @NotNull public @NotNull Number getBalance(org.bukkit.OfflinePlayer offlinePlayer)
      Description copied from interface: Economy
      Returns an amount of money that player has currently on his balance.
      Specified by:
      getBalance in interface Economy
      Parameters:
      offlinePlayer - Player to check balance.
      Returns:
      Amount of money on player's balance.
    • start

      public void start()
      Description copied from interface: Startable
      Does tasks on start.
      Specified by:
      start in interface Startable
    • isWorking

      public boolean isWorking()
      Description copied from interface: Toggleable
      Checks whether manager was started successfully and it currently works.
      Specified by:
      isWorking in interface Toggleable
      Returns:
      true - started up, false - shut downed.
    • shutdown

      public void shutdown()
      Description copied from interface: ShutDownable
      Does tasks on shutdown.
      Specified by:
      shutdown in interface ShutDownable
    • getName

      @NotNull public @NotNull String getName()
      Description copied from interface: Manager
      Returns name of manager, that will be displayed by request in the logs.
      Specified by:
      getName in interface Manager
      Returns:
      name of manager.