Interface TimeFormatter


public interface TimeFormatter
Renders durations and dates in the reader's own language.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Milliseconds per tick, used to convert the tick counts the config uses.
  • Method Summary

    Modifier and Type
    Method
    Description
    format(FPlayer fPlayer, long time)
    Renders a duration using the player's language.
    format(FPlayer fPlayer, long time, String message)
    Renders a duration into a pattern that decides which units are shown.
    formatDate(long date)
    Renders a point in time using the format configured for the server.
  • Field Details

    • MULTIPLIER

      static final long MULTIPLIER
      Milliseconds per tick, used to convert the tick counts the config uses.
      See Also:
  • Method Details

    • format

      String format(FPlayer fPlayer, long time)
      Renders a duration using the player's language.
      Parameters:
      fPlayer - the reader
      time - the duration in milliseconds
      Returns:
      the rendered duration
    • format

      String format(FPlayer fPlayer, long time, String message)
      Renders a duration into a pattern that decides which units are shown.
      Parameters:
      fPlayer - the reader
      time - the duration in milliseconds
      message - the pattern from the localization file
      Returns:
      the rendered duration
    • formatDate

      String formatDate(long date)
      Renders a point in time using the format configured for the server.
      Parameters:
      date - the timestamp in milliseconds
      Returns:
      the rendered date