public static class TextBuilder.Selector extends TextBuilder
TextBuilder
creating immutable Text.Selector
instances.Text.Selector
TextBuilder.Literal, TextBuilder.Placeholder, TextBuilder.Score, TextBuilder.Selector, TextBuilder.Translatable
Modifier and Type | Field and Description |
---|---|
protected Selector |
selector |
children, clickAction, format, hoverAction, shiftClickAction
Modifier and Type | Method and Description |
---|---|
TextBuilder.Selector |
append(Iterable<? extends Text> children)
Appends the specified
Text to the end of this text. |
TextBuilder.Selector |
append(Text... children)
Appends the specified
Text to the end of this text. |
Text.Selector |
build()
Builds an immutable instance of the current state of this text builder.
|
TextBuilder.Selector |
color(TextColor color)
Sets the
TextColor of this text. |
boolean |
equals(Object o) |
Selector |
getSelector()
Returns the current selector of this builder.
|
int |
hashCode() |
TextBuilder.Selector |
insert(int pos,
Iterable<? extends Text> children)
Inserts the specified
Text at the given position of this builder. |
TextBuilder.Selector |
insert(int pos,
Text... children)
Inserts the specified
Text at the given position of this builder. |
TextBuilder.Selector |
onClick(ClickAction<?> clickAction)
Sets the
ClickAction that will be executed if the text is clicked
in the chat. |
TextBuilder.Selector |
onHover(HoverAction<?> hoverAction)
Sets the
HoverAction that will be executed if the text is hovered
in the chat. |
TextBuilder.Selector |
onShiftClick(ShiftClickAction<?> shiftClickAction)
Sets the
ShiftClickAction that will be executed if the text is
shift-clicked in the chat. |
TextBuilder.Selector |
remove(Iterable<? extends Text> children)
Removes the specified
Text from this builder. |
TextBuilder.Selector |
remove(Text... children)
Removes the specified
Text from this builder. |
TextBuilder.Selector |
removeAll()
Removes all children from this builder.
|
TextBuilder.Selector |
selector(Selector selector)
Sets the selector of the text.
|
TextBuilder.Selector |
style(TextStyle... styles)
Sets the text styles of this text.
|
String |
toString() |
format, getChildren, getClickAction, getColor, getFormat, getHoverAction, getShiftClickAction, getStyle, toText
protected Selector selector
public final Selector getSelector()
Text.Selector.getSelector()
public TextBuilder.Selector selector(Selector selector)
selector
- The selector for this builder to useText.Selector.getSelector()
public Text.Selector 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.Selector color(TextColor color)
TextBuilder
TextColor
of this text.color
in class TextBuilder
color
- The new text color for this textText.getColor()
public TextBuilder.Selector 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.Selector 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.Selector 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.Selector 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.Selector append(Text... children)
TextBuilder
Text
to the end of this text.append
in class TextBuilder
children
- The texts to appendText.getChildren()
public TextBuilder.Selector 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.Selector 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.Selector 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.Selector remove(Text... children)
TextBuilder
Text
from this builder.remove
in class TextBuilder
children
- The texts to removeText.getChildren()
public TextBuilder.Selector remove(Iterable<? extends Text> children)
TextBuilder
Text
from this builder.remove
in class TextBuilder
children
- The texts to removeText.getChildren()
public TextBuilder.Selector removeAll()
TextBuilder
removeAll
in class TextBuilder
Text.getChildren()