Class Scoreboard.Builder
java.lang.Object
me.remigio07.chatplugin.api.server.scoreboard.Scoreboard.Builder
- Enclosing class:
Scoreboard
Represents the builder used to create
Scoreboard
s using
ScoreboardManager.createScoreboardBuilder(String, boolean, List)
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Scoreboard
build()
Builds the scoreboard.abstract Scoreboard.Builder
Sets one of this builder's lines.abstract Scoreboard.Builder
setNumbers
(NumbersDisplayMode displayMode, String customTextValue, long customTextColorsCycleTimeout, int customTextColorsInterpolations, List<ChatColor> customTextColorsGradient) Sets this builder's numbers.abstract Scoreboard.Builder
Sets this builder's titles.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setTitles
public abstract Scoreboard.Builder setTitles(Map<Language, List<String>> values, boolean randomOrder, long sendingTimeout) Sets this builder's titles.- Parameters:
values
- Titles' valuesrandomOrder
- Whether to use a random ordersendingTimeout
- Time between sendings- Returns:
- This builder
- Throws:
NoSuchElementException
- Ifvalues.get(
Language.getMainLanguage()
) == null
-
setLine
public abstract Scoreboard.Builder setLine(Map<Language, List<String>> values, int lineIndex, boolean randomOrder, long sendingTimeout) Sets one of this builder's lines.- Parameters:
values
- Line's valueslineIndex
- Line's index (0 - 14)randomOrder
- Whether to use a random ordersendingTimeout
- Time between sendings- Returns:
- This builder
- Throws:
NoSuchElementException
- Ifvalues.get(
Language.getMainLanguage()
) == nullIndexOutOfBoundsException
- IflineIndex < 0 || lineIndex > 14
-
setNumbers
public abstract Scoreboard.Builder setNumbers(NumbersDisplayMode displayMode, String customTextValue, long customTextColorsCycleTimeout, int customTextColorsInterpolations, List<ChatColor> customTextColorsGradient) Sets this builder's numbers.- Parameters:
displayMode
- Numbers' display modecustomTextValue
- Numbers' custom text's valuecustomTextColorsCycleTimeout
- Time between color cyclescustomTextColorsInterpolations
- Interpolations between provided colorscustomTextColorsGradient
- Colors to cycle through- Returns:
- This builder
- Throws:
UnsupportedOperationException
- If!
NumbersDisplayMode.isSupported()
IllegalArgumentException
- IfcustomTextColorsCycleTimeout < 1 || customTextColorsInterpolations < 0 || customTextColorsGradient.isEmpty()
-
build
Builds the scoreboard.- Returns:
- New scoreboard
- Throws:
IllegalStateException
- If one of the following has not been called yet:
-