Class ScoreboardLines.ScoreboardLine

java.lang.Object
java.util.TimerTask
me.remigio07.chatplugin.api.server.scoreboard.ScoreboardLines.ScoreboardLine
All Implemented Interfaces:
Runnable
Enclosing class:
ScoreboardLines

public abstract static class ScoreboardLines.ScoreboardLine extends TimerTask
Represents a Scoreboard's line.
  • Constructor Details

    • ScoreboardLine

      public ScoreboardLine()
  • Method Details

    • getLines

      public ScoreboardLines getLines()
      Gets the lines associated with this line.
      Returns:
      Associated lines
    • getValues

      public Map<Language,List<String>> getValues()
      Gets this line's values.

      You may modify the returned map, but it cannot point to a null value for Language.getMainLanguage() and empty Lists are not allowed.

      Found at: "lines." + getLineIndex() + ".values" in Scoreboard.getConfiguration()

      Returns:
      Line's values
    • getValues

      public List<String> getValues(Language language, boolean avoidNull)
      Gets this line's values for the specified language.

      Specify true as avoidNull to fall back to Language.getMainLanguage()'s values if no values are present for the specified language. Will return null if getValues().get(language) == null && !avoidNull.

      Parameters:
      language - Language used to translate the values
      avoidNull - Whether to avoid returning null
      Returns:
      Line's values
    • getTimerIndexes

      public Map<Language,Integer> getTimerIndexes()
      Gets the run()'s timer's indexes of getValues().
      Returns:
      Titles' timer's indexes
    • getLineIndex

      public int getLineIndex()
      Gets this line's index in ScoreboardLines.getLines().
      Returns:
      Line's index (0 - 14)
    • isRandomOrder

      public boolean isRandomOrder()
      Checks if the values should be sent in a random order.

      Found at: "lines." + getLineIndex() + ".random-order" in Scoreboard.getConfiguration()

      Returns:
      Whether to use a random order
    • getSendingTimeout

      public long getSendingTimeout()
      Gets the timeout between sendings, in milliseconds.

      Found at: "lines." + getLineIndex() + ".sending-timeout-ms" in Scoreboard.getConfiguration()

      Returns:
      Time between sendings
    • run

      public abstract void run()
      Automatic line sender, called once every getSendingTimeout() ms.
      Specified by:
      run in interface Runnable
      Specified by:
      run in class TimerTask