Interface Currency


public interface Currency
The server's single currency. Amounts are long counts of the smallest unit.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Decimal places (2 means 12345 is 123.45).
    format(long amount)
    Formats using the owner's configured format, for example "123.45 coins".
    long
    parse(String text)
    Parses player input such as "12", "1.5", "1.5k" or "2m".
    Plural name, for example "coins".
    Singular name, for example "coin".
    Symbol, for example "⛁".
  • Method Details

    • singular

      String singular()
      Singular name, for example "coin".
    • plural

      String plural()
      Plural name, for example "coins".
    • symbol

      String symbol()
      Symbol, for example "⛁".
    • decimals

      int decimals()
      Decimal places (2 means 12345 is 123.45).
    • format

      String format(long amount)
      Formats using the owner's configured format, for example "123.45 coins".
    • parse

      long parse(String text)
      Parses player input such as "12", "1.5", "1.5k" or "2m".
      Returns:
      the amount in the smallest unit
      Throws:
      IllegalArgumentException - if the text isn't a valid amount for this currency