Class MoneyUtil

java.lang.Object
com.palmergames.bukkit.towny.utils.MoneyUtil

public class MoneyUtil extends Object
  • Constructor Details

    • MoneyUtil

      public MoneyUtil()
  • Method Details

    • getTownDebtCap

      public static double getTownDebtCap(Town town, double upkeep)
    • getEstimatedValueOfTown

      public 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.
      Parameters:
      town - The town to estimate a value for.
      Returns:
      the estimated monetary value of the town.
    • townWithdraw

      public static void townWithdraw(org.bukkit.entity.Player player, Resident resident, Town town, int amount)
    • townDeposit

      public static void townDeposit(org.bukkit.entity.Player player, Resident resident, Town town, Nation nation, int amount)
    • nationWithdraw

      public static void nationWithdraw(org.bukkit.entity.Player player, Resident resident, Nation nation, int amount)
    • nationDeposit

      public static void nationDeposit(org.bukkit.entity.Player player, Resident resident, Nation nation, int amount)
    • checkLegacyDebtAccounts

      public static void checkLegacyDebtAccounts()
      For a short time Towny stored debt accounts in the server's economy plugin. This practice had to end, being replaced with the debtBalance which is stored in the Town object.
    • getMoneyAboveZeroOrThrow

      public static double getMoneyAboveZeroOrThrow(String input) throws TownyException
      Throws:
      TownyException
    • returnPurchasedBlocksCost

      public static double returnPurchasedBlocksCost(int alreadyPurchased, int toPurchase, Town town)
    • addTownMoneyComponents

      public static void addTownMoneyComponents(Town town, Translator translator, StatusScreen screen)
      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.