public class KeybindText extends BaseText
Text.Serializer
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T>
Modifier and Type | Field and Description |
---|---|
private String |
key |
private Supplier<Text> |
translated |
private static Function<String,Supplier<Text>> |
translator |
EMPTY, TERMINATE_VISIT
Constructor and Description |
---|
KeybindText(String key) |
Modifier and Type | Method and Description |
---|---|
KeybindText |
copy()
Copies the text itself, excluding the styles or siblings.
|
boolean |
equals(Object obj) |
String |
getKey() |
private Text |
getTranslated() |
static void |
setTranslator(Function<String,Supplier<Text>> translator) |
String |
toString() |
<T> Optional<T> |
visitSelf(StringVisitable.StyledVisitor<T> visitor,
Style style)
Visits the text itself.
|
<T> Optional<T> |
visitSelf(StringVisitable.Visitor<T> visitor)
Visits the text itself.
|
append, asOrderedText, asString, getSiblings, getStyle, hashCode, setStyle, shallowCopy
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
append, fillStyle, formatted, formatted, styled
asTruncatedString, getString, of, visit, visit
concat, concat, plain, styled
private final String key
public KeybindText(String key)
@Environment(value=CLIENT) public static void setTranslator(Function<String,Supplier<Text>> translator)
private Text getTranslated()
public <T> Optional<T> visitSelf(StringVisitable.Visitor<T> visitor)
visitor
- the visitorStringVisitable.visit(Visitor)
@Environment(value=CLIENT) public <T> Optional<T> visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)
visitor
- the visitorstyle
- the current styleStringVisitable.visit(StyledVisitor, Style)
public KeybindText copy()
Text
public String getKey()