Class MoneyUtil
java.lang.Object
com.palmergames.bukkit.towny.utils.MoneyUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addNationMoneyComponentsToScreen
(Nation nation, Translator translator, StatusScreen screen) Populates the StatusScreen with the various bank and money components.static void
addTownMoneyComponents
(Town town, Translator translator, StatusScreen screen) Populates the StatusScreen with the various bank and money components.static double
getEstimatedValueOfTown
(Town town) Get estimated value of town Useful when calculating the allowed debt cap for a town Covers new town costs, claimed land costs, purchased outposts costs.static double
getMoneyAboveZeroOrThrow
(String input) static double
getTownDebtCap
(Town town, double upkeep) static void
nationDeposit
(org.bukkit.entity.Player player, Resident resident, Nation nation, int amount) static void
nationWithdraw
(org.bukkit.entity.Player player, Resident resident, Nation nation, int amount) static double
returnPurchasedBlocksCost
(int alreadyPurchased, int toPurchase, Town town) static void
townDeposit
(org.bukkit.entity.Player player, Resident resident, Town town, Nation nation, int amount) static void
townWithdraw
(org.bukkit.entity.Player player, Resident resident, Town town, int amount)
-
Constructor Details
-
MoneyUtil
public MoneyUtil()
-
-
Method Details
-
getTownDebtCap
-
getEstimatedValueOfTown
Get estimated value of town Useful when calculating the allowed debt cap for a town Covers new town costs, claimed land costs, purchased outposts costs.- Parameters:
town
- The town to estimate a value for.- Returns:
- the estimated monetary value of the town.
-
townWithdraw
-
townDeposit
-
nationWithdraw
-
nationDeposit
-
getMoneyAboveZeroOrThrow
- Throws:
TownyException
-
returnPurchasedBlocksCost
-
addTownMoneyComponents
Populates the StatusScreen with the various bank and money components.- Parameters:
town
- Town of which to generate a bankstring.translator
- Translator used in choosing language.screen
- StatusScreen to add components to.
-
addNationMoneyComponentsToScreen
public static void addNationMoneyComponentsToScreen(Nation nation, Translator translator, StatusScreen screen) Populates the StatusScreen with the various bank and money components.- Parameters:
nation
- Nation of which to generate a bankstring.translator
- Translator used in choosing language.screen
- StatusScreen to add components to.
-