Package net.minecraft.text
Class KeybindText
java.lang.Object
net.minecraft.text.BaseText
net.minecraft.text.KeybindText
- All Implemented Interfaces:
com.mojang.brigadier.Message,MutableText,StringVisitable,Text
public class KeybindText extends BaseText
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.text.StringVisitable
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T>Nested classes/interfaces inherited from interface net.minecraft.text.Text
Text.Serializer -
Field Summary
Fields Modifier and Type Field Description private Stringkeyprivate Supplier<Text>translatedprivate static Function<String,Supplier<Text>>translatorFields inherited from interface net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT -
Constructor Summary
Constructors Constructor Description KeybindText(String key) -
Method Summary
Modifier and Type Method Description KeybindTextcopy()Copies the text itself, excluding the styles or siblings.booleanequals(Object obj)StringgetKey()private TextgetTranslated()static voidsetTranslator(Function<String,Supplier<Text>> translator)StringtoString()<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.Methods inherited from class net.minecraft.text.BaseText
append, asOrderedText, asString, getSiblings, getStyle, hashCode, setStyle, shallowCopyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.text.MutableText
append, fillStyle, formatted, formatted, styledMethods inherited from interface net.minecraft.text.Text
asTruncatedString, getString, visit, visit
-
Field Details
-
translator
-
key
-
translated
-
-
Constructor Details
-
KeybindText
-
-
Method Details
-
setTranslator
-
getTranslated
-
visitSelf
Visits the text itself.- Parameters:
visitor- the visitor- Returns:
- the visitor's return value
- See Also:
Text.visit(Visitor)
-
visitSelf
@Environment(CLIENT) public <T> Optional<T> visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)Visits the text itself.- Parameters:
visitor- the visitorstyle- the current style- Returns:
- the visitor's return value
- See Also:
Text.visit(StyledVisitor, Style)
-
copy
Description copied from interface:TextCopies the text itself, excluding the styles or siblings. -
equals
-
toString
-
getKey
-