Package com.plotsquared.core.util
Class EconHandler
java.lang.Object
com.plotsquared.core.util.EconHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddepositMoney(OfflinePlotPlayer player, double amount) abstract voiddepositMoney(PlotPlayer<?> player, double amount) format(double balance) Formats the given balance into a human-readable number.abstract doublegetBalance(PlotPlayer<?> player) doublegetMoney(PlotPlayer<?> player) abstract booleaninit()abstract booleanReturns whether economy is enabled in the given plot area or not.abstract booleanReturns whether economy is supported by the server or not.static EconHandlerReturns an econ handler that: ReturnsfalseonisEnabled(PlotArea)ReturnsDouble.MIN_VALUEongetBalance(PlotPlayer)Doesn't do anything forwithdrawMoney(PlotPlayer, double),depositMoney(OfflinePlotPlayer, double)depositMoney(PlotPlayer, double)abstract voidwithdrawMoney(PlotPlayer<?> player, double amount)
-
Constructor Details
-
EconHandler
public EconHandler()
-
-
Method Details
-
nullEconHandler
Returns an econ handler that:- Returns
falseonisEnabled(PlotArea) - Returns
Double.MIN_VALUEongetBalance(PlotPlayer) - Doesn't do anything for
withdrawMoney(PlotPlayer, double),depositMoney(OfflinePlotPlayer, double)depositMoney(PlotPlayer, double)
- Returns:
- A null econ handler
- Returns
-
init
-
getMoney
-
getBalance
-
withdrawMoney
-
depositMoney
-
depositMoney
-
isEnabled
Returns whether economy is enabled in the given plot area or not. Implementations should only return true ifisSupported()returns true too.- Parameters:
plotArea- the plot area to check- Returns:
trueif economy is enabled on the given plot area,falseotherwise.
-
format
Formats the given balance into a human-readable number.- Parameters:
balance- the balance to format.- Returns:
- the balance as formatted string.
-
isSupported
Returns whether economy is supported by the server or not.- Returns:
trueif economy is supported,falseotherwise.
-