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 String
key
private Supplier<Text>
translated
private static Function<String,Supplier<Text>>
translator
Fields 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 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.Methods inherited from class net.minecraft.text.BaseText
append, asOrderedText, asString, getSiblings, getStyle, hashCode, setStyle, shallowCopy
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.text.MutableText
append, fillStyle, formatted, formatted, styled
Methods 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:Text
Copies the text itself, excluding the styles or siblings. -
equals
-
toString
-
getKey
-