public static class TextBuilder.Score extends TextBuilder
TextBuilder
creating immutable Text.Score
instances.Text.Score
TextBuilder.Literal, TextBuilder.Placeholder, TextBuilder.Score, TextBuilder.Selector, TextBuilder.Translatable
Modifier and Type | Field and Description |
---|---|
protected String |
override |
protected Score |
score |
children, clickAction, format, hoverAction, shiftClickAction
Modifier and Type | Method and Description |
---|---|
TextBuilder.Score |
append(Iterable<? extends Text> children)
Appends the specified
Text to the end of this text. |
TextBuilder.Score |
append(Text... children)
Appends the specified
Text to the end of this text. |
Text.Score |
build()
Builds an immutable instance of the current state of this text builder.
|
TextBuilder.Score |
color(TextColor color)
Sets the
TextColor of this text. |
boolean |
equals(Object o) |
Optional<String> |
getOverride()
Returns the current override of this builder.
|
Score |
getScore()
Returns the current score of this builder.
|
int |
hashCode() |
TextBuilder.Score |
insert(int pos,
Iterable<? extends Text> children)
Inserts the specified
Text at the given position of this builder. |
TextBuilder.Score |
insert(int pos,
Text... children)
Inserts the specified
Text at the given position of this builder. |
TextBuilder.Score |
onClick(ClickAction<?> clickAction)
Sets the
ClickAction that will be executed if the text is clicked
in the chat. |
TextBuilder.Score |
onHover(HoverAction<?> hoverAction)
Sets the
HoverAction that will be executed if the text is hovered
in the chat. |
TextBuilder.Score |
onShiftClick(ShiftClickAction<?> shiftClickAction)
Sets the
ShiftClickAction that will be executed if the text is
shift-clicked in the chat. |
TextBuilder.Score |
override(String override)
Overrides the real score and displays a custom text instead.
|
TextBuilder.Score |
remove(Iterable<? extends Text> children)
Removes the specified
Text from this builder. |
TextBuilder.Score |
remove(Text... children)
Removes the specified
Text from this builder. |
TextBuilder.Score |
removeAll()
Removes all children from this builder.
|
TextBuilder.Score |
score(Score score)
Sets the score of the text.
|
TextBuilder.Score |
style(TextStyle... styles)
Sets the text styles of this text.
|
String |
toString() |
format, getChildren, getClickAction, getColor, getFormat, getHoverAction, getShiftClickAction, getStyle, toText
public final Score getScore()
Text.Score.getScore()
public TextBuilder.Score score(Score score)
score
- The score for this builder to useText.Score.getScore()
public final Optional<String> getOverride()
Optional.empty()
if noneText.Score.getOverride()
public TextBuilder.Score override(@Nullable String override)
override
- The text to override the score with or null
to resetText.Score.getOverride()
public Text.Score build()
TextBuilder
build
in class TextBuilder
Text
with the current properties of this
builderpublic boolean equals(@Nullable Object o)
equals
in class TextBuilder
public int hashCode()
hashCode
in class TextBuilder
public String toString()
toString
in class TextBuilder
public TextBuilder.Score color(TextColor color)
TextBuilder
TextColor
of this text.color
in class TextBuilder
color
- The new text color for this textText.getColor()
public TextBuilder.Score style(TextStyle... styles)
TextBuilder
TextStyle
of the current style and the specified styles first and
set it to the text.style
in class TextBuilder
styles
- The text styles to applyText.getStyle()
public TextBuilder.Score onClick(@Nullable ClickAction<?> clickAction)
TextBuilder
ClickAction
that will be executed if the text is clicked
in the chat.onClick
in class TextBuilder
clickAction
- The new click action for the textText.getClickAction()
public TextBuilder.Score onHover(@Nullable HoverAction<?> hoverAction)
TextBuilder
HoverAction
that will be executed if the text is hovered
in the chat.onHover
in class TextBuilder
hoverAction
- The new hover action for the textText.getHoverAction()
public TextBuilder.Score onShiftClick(@Nullable ShiftClickAction<?> shiftClickAction)
TextBuilder
ShiftClickAction
that will be executed if the text is
shift-clicked in the chat.onShiftClick
in class TextBuilder
shiftClickAction
- The new shift click action for the textText.getShiftClickAction()
public TextBuilder.Score append(Text... children)
TextBuilder
Text
to the end of this text.append
in class TextBuilder
children
- The texts to appendText.getChildren()
public TextBuilder.Score append(Iterable<? extends Text> children)
TextBuilder
Text
to the end of this text.append
in class TextBuilder
children
- The texts to appendText.getChildren()
public TextBuilder.Score insert(int pos, Text... children)
TextBuilder
Text
at the given position of this builder.insert
in class TextBuilder
pos
- The position to insert the texts tochildren
- The texts to insertText.getChildren()
public TextBuilder.Score insert(int pos, Iterable<? extends Text> children)
TextBuilder
Text
at the given position of this builder.insert
in class TextBuilder
pos
- The position to insert the texts tochildren
- The texts to insertText.getChildren()
public TextBuilder.Score remove(Text... children)
TextBuilder
Text
from this builder.remove
in class TextBuilder
children
- The texts to removeText.getChildren()
public TextBuilder.Score remove(Iterable<? extends Text> children)
TextBuilder
Text
from this builder.remove
in class TextBuilder
children
- The texts to removeText.getChildren()
public TextBuilder.Score removeAll()
TextBuilder
removeAll
in class TextBuilder
Text.getChildren()