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