Package net.minecraft.network.chat
Class MutableComponent
java.lang.Object
net.minecraft.network.chat.MutableComponent
- All Implemented Interfaces:
com.mojang.brigadier.Message
,Component
,FormattedText
A Component which can have its Style and siblings modified.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.chat.Component
Component.Serializer, Component.SerializerAdapter
Nested classes/interfaces inherited from interface net.minecraft.network.chat.FormattedText
FormattedText.ContentConsumer<T>, FormattedText.StyledContentConsumer<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ComponentContents
private Language
private Style
private FormattedCharSequence
Fields inherited from interface net.minecraft.network.chat.FormattedText
EMPTY, STOP_ITERATION
-
Constructor Summary
ConstructorsConstructorDescriptionMutableComponent
(ComponentContents pContents, List<Component> pSiblings, Style pStyle) -
Method Summary
Modifier and TypeMethodDescriptionAdd the given text to this component's siblings.Add the given component to this component's siblings.static MutableComponent
create
(ComponentContents pContents) boolean
getStyle()
int
hashCode()
Sets the style for this component and returns the component itself.toString()
withColor
(int pColor) withStyle
(UnaryOperator<Style> pModifyFunc) withStyle
(ChatFormatting pFormat) withStyle
(ChatFormatting... pFormats) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.chat.Component
contains, copy, getString, getString, plainCopy, toFlatList, toFlatList, tryCollapseToString, visit, visit
-
Field Details
-
contents
-
siblings
-
style
-
visualOrderText
-
decomposedWith
-
-
Constructor Details
-
MutableComponent
MutableComponent(ComponentContents pContents, List<Component> pSiblings, Style pStyle)
-
-
Method Details
-
create
-
getContents
- Specified by:
getContents
in interfaceComponent
-
getSiblings
- Specified by:
getSiblings
in interfaceComponent
-
setStyle
Sets the style for this component and returns the component itself. -
getStyle
-
append
Add the given text to this component's siblings. Note: If this component turns the text bold, that will apply to all the siblings until a later sibling turns the text something else. -
append
Add the given component to this component's siblings. Note: If this component turns the text bold, that will apply to all the siblings until a later sibling turns the text something else. -
withStyle
-
withStyle
-
withStyle
-
withStyle
-
withColor
-
getVisualOrderText
- Specified by:
getVisualOrderText
in interfaceComponent
-
equals
-
hashCode
public int hashCode() -
toString
-