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 OrderedText
orderedText
private Language
previousLanguage
protected List<Text>
siblings
private Style
style
Fields inherited from interface net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT
-
Constructor Summary
Constructors Constructor Description BaseText()
-
Method Summary
Modifier and Type Method Description MutableText
append(Text text)
Appends a text to this text's siblings.OrderedText
asOrderedText()
String
asString()
Returns the string representation of this text itself, excluding siblings.abstract BaseText
copy()
Copies the text itself, excluding the styles or siblings.boolean
equals(Object obj)
List<Text>
getSiblings()
Returns the siblings of this text.Style
getStyle()
Returns the style of this text.int
hashCode()
MutableText
setStyle(Style style)
Sets the style of this text.MutableText
shallowCopy()
Copies the text itself, the style, and the siblings.String
toString()
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:
append
in 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:
getSiblings
in interfaceText
-
setStyle
Sets the style of this text.- Specified by:
setStyle
in interfaceMutableText
-
getStyle
Returns the style of this text. -
copy
Description copied from interface:Text
Copies 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:
shallowCopy
in interfaceText
-
asOrderedText
- Specified by:
asOrderedText
in interfaceText
-
equals
-
hashCode
public int hashCode() -
toString
-