Class MoneyUtil
java.lang.Object
com.palmergames.bukkit.towny.utils.MoneyUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNationMoneyComponentsToScreen(Nation nation, Translator translator, StatusScreen screen) Populates the StatusScreen with the various bank and money components.static voidaddTownMoneyComponents(Town town, Translator translator, StatusScreen screen) Populates the StatusScreen with the various bank and money components.static doublegetEstimatedValueOfTown(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 doublegetMoneyAboveZeroOrThrow(String input) static doublegetTownDebtCap(Town town, double upkeep) static voidnationDeposit(org.bukkit.entity.Player player, Resident resident, Nation nation, int amount) static voidnationWithdraw(org.bukkit.entity.Player player, Resident resident, Nation nation, int amount) static doublereturnPurchasedBlocksCost(int alreadyPurchased, int toPurchase, Town town) static voidtownDeposit(org.bukkit.entity.Player player, Resident resident, Town town, Nation nation, int amount) static voidtownWithdraw(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.
-