Class EconHandler

java.lang.Object
com.plotsquared.core.util.EconHandler

public abstract class EconHandler extends Object
  • Constructor Details

    • EconHandler

      public EconHandler()
  • Method Details

    • nullEconHandler

      public static EconHandler nullEconHandler()
      Returns:
      A null econ handler
    • init

      public abstract boolean init()
    • getMoney

      public double getMoney(PlotPlayer<?> player)
    • getBalance

      public abstract double getBalance(PlotPlayer<?> player)
    • withdrawMoney

      public abstract void withdrawMoney(PlotPlayer<?> player, double amount)
    • depositMoney

      public abstract void depositMoney(PlotPlayer<?> player, double amount)
    • depositMoney

      public abstract void depositMoney(OfflinePlotPlayer player, double amount)
    • isEnabled

      public abstract boolean isEnabled(PlotArea plotArea)
      Returns whether economy is enabled in the given plot area or not. Implementations should only return true if isSupported() returns true too.
      Parameters:
      plotArea - the plot area to check
      Returns:
      true if economy is enabled on the given plot area, false otherwise.
    • format

      public abstract @NonNull String format(double balance)
      Formats the given balance into a human-readable number.
      Parameters:
      balance - the balance to format.
      Returns:
      the balance as formatted string.
    • isSupported

      public abstract boolean isSupported()
      Returns whether economy is supported by the server or not.
      Returns:
      true if economy is supported, false otherwise.