Package net.minecraft.text
Class BaseText
java.lang.Object
net.minecraft.text.BaseText
- All Implemented Interfaces:
com.mojang.brigadier.Message,MutableText,StringVisitable,Text
- Direct Known Subclasses:
KeybindText,LiteralText,NbtText,ScoreText,SelectorText,TranslatableText
public abstract class BaseText extends Object implements MutableText
-
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 OrderedTextorderedTextprivate LanguagepreviousLanguageprotected List<Text>siblingsprivate StylestyleFields inherited from interface net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT -
Constructor Summary
Constructors Constructor Description BaseText() -
Method Summary
Modifier and Type Method Description MutableTextappend(Text text)Appends a text to this text's siblings.OrderedTextasOrderedText()StringasString()Returns the string representation of this text itself, excluding siblings.abstract BaseTextcopy()Copies the text itself, excluding the styles or siblings.booleanequals(Object obj)List<Text>getSiblings()Returns the siblings of this text.StylegetStyle()Returns the style of this text.inthashCode()MutableTextsetStyle(Style style)Sets the style of this text.MutableTextshallowCopy()Copies the text itself, the style, and the siblings.StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
siblings
-
orderedText
-
previousLanguage
-
style
-
-
Constructor Details
-
BaseText
public BaseText()
-
-
Method Details
-
append
Appends a text to this text's siblings.- Specified by:
appendin interfaceMutableText- Parameters:
text- the sibling
-
asString
Returns the string representation of this text itself, excluding siblings. -
getSiblings
Returns the siblings of this text.- Specified by:
getSiblingsin interfaceText
-
setStyle
Sets the style of this text.- Specified by:
setStylein interfaceMutableText
-
getStyle
Returns the style of this text. -
copy
Description copied from interface:TextCopies the text itself, excluding the styles or siblings. -
shallowCopy
Copies the text itself, the style, and the siblings.A shallow copy is made for the siblings.
- Specified by:
shallowCopyin interfaceText
-
asOrderedText
- Specified by:
asOrderedTextin interfaceText
-
equals
-
hashCode
public int hashCode() -
toString
-