Package com.plotsquared.core.util
Class EconHandler
java.lang.Object
com.plotsquared.core.util.EconHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
depositMoney
(OfflinePlotPlayer player, double amount) abstract void
depositMoney
(PlotPlayer<?> player, double amount) format
(double balance) Formats the given balance into a human-readable number.abstract double
getBalance
(PlotPlayer<?> player) double
getMoney
(PlotPlayer<?> player) abstract boolean
init()
abstract boolean
Returns whether economy is enabled in the given plot area or not.abstract boolean
Returns whether economy is supported by the server or not.static EconHandler
Returns an econ handler that: Returnsfalse
onisEnabled(PlotArea)
ReturnsDouble.MIN_VALUE
ongetBalance(PlotPlayer)
Doesn't do anything forwithdrawMoney(PlotPlayer, double)
,depositMoney(OfflinePlotPlayer, double)
depositMoney(PlotPlayer, double)
abstract void
withdrawMoney
(PlotPlayer<?> player, double amount)
-
Constructor Details
-
EconHandler
public EconHandler()
-
-
Method Details
-
nullEconHandler
Returns an econ handler that:- Returns
false
onisEnabled(PlotArea)
- Returns
Double.MIN_VALUE
ongetBalance(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:
true
if economy is enabled on the given plot area,false
otherwise.
-
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:
true
if economy is supported,false
otherwise.
-