public abstract class TextComponentBase extends java.lang.Object implements ITextComponent
ITextComponent.Serializer| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<ITextComponent> |
siblings
The later siblings of this component.
|
| Constructor and Description |
|---|
TextComponentBase() |
| Modifier and Type | Method and Description |
|---|---|
ITextComponent |
appendSibling(ITextComponent component)
Adds a new component to the end of the sibling list, setting that component's style's parent style to this
component's style.
|
ITextComponent |
appendText(java.lang.String text)
Adds a new component to the end of the sibling list, with the specified text.
|
static java.util.Iterator<ITextComponent> |
createDeepCopyIterator(java.lang.Iterable<ITextComponent> components)
Creates an iterator that iterates over the given components, returning deep copies of each component in turn so
that the properties of the returned objects will remain externally consistent after being returned.
|
boolean |
equals(java.lang.Object p_equals_1_) |
java.lang.String |
getFormattedText()
Gets the text of this component and all sibling components, with formatting codes added for rendering.
|
java.util.List<ITextComponent> |
getSiblings()
Gets the sibling components of this one.
|
Style |
getStyle()
Gets the style of this component.
|
java.lang.String |
getUnformattedText()
Gets the text of this component and all sibling components, without any formatting codes.
|
int |
hashCode() |
java.util.Iterator<ITextComponent> |
iterator() |
ITextComponent |
setStyle(Style style)
Sets the style of this component and updates the parent style of all of the sibling components.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateCopy, getUnformattedComponentTextprotected java.util.List<ITextComponent> siblings
public ITextComponent appendSibling(ITextComponent component)
appendSibling in interface ITextComponentpublic java.util.List<ITextComponent> getSiblings()
getSiblings in interface ITextComponentpublic ITextComponent appendText(java.lang.String text)
appendSibling(ITextComponent) with a new TextComponentString.appendText in interface ITextComponentpublic ITextComponent setStyle(Style style)
setStyle in interface ITextComponentpublic Style getStyle()
setStyle(Style) again after modifying it).
If this component's style is currently null, it will be initialized to the default style, and the
parent style of all sibling components will be set to that style. (IE, changes to this style will also be
reflected in sibling components.)
This method never returns null.getStyle in interface ITextComponentpublic java.util.Iterator<ITextComponent> iterator()
iterator in interface java.lang.Iterable<ITextComponent>public final java.lang.String getUnformattedText()
getUnformattedText in interface ITextComponentpublic final java.lang.String getFormattedText()
getFormattedText in interface ITextComponentpublic static java.util.Iterator<ITextComponent> createDeepCopyIterator(java.lang.Iterable<ITextComponent> components)
public boolean equals(java.lang.Object p_equals_1_)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object