public class TextComponentTranslation extends TextComponentBase
ITextComponent.Serializer
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
STRING_VARIABLE_PATTERN |
siblings
Constructor and Description |
---|
TextComponentTranslation(java.lang.String translationKey,
java.lang.Object... args) |
Modifier and Type | Method and Description |
---|---|
TextComponentTranslation |
createCopy()
Creates a copy of this component.
|
boolean |
equals(java.lang.Object p_equals_1_) |
java.lang.Object[] |
getFormatArgs()
Gets the object array that is used to translate the key.
|
java.lang.String |
getKey()
Gets the key used to translate this component.
|
java.lang.String |
getUnformattedComponentText()
Gets the raw content of this component (but not its sibling components), without any formatting codes.
|
int |
hashCode() |
protected void |
initializeFromFormat(java.lang.String format)
Initializes the content of this component, substituting in variables.
|
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() |
appendSibling, appendText, createDeepCopyIterator, getFormattedText, getSiblings, getStyle, getUnformattedText
public static final java.util.regex.Pattern STRING_VARIABLE_PATTERN
public TextComponentTranslation(java.lang.String translationKey, java.lang.Object... args)
protected void initializeFromFormat(java.lang.String format)
format
- The format string to use (already translated with I18n.translateToLocal(String)
, but not
formatted)public ITextComponent setStyle(Style style)
setStyle
in interface ITextComponent
setStyle
in class TextComponentBase
public java.util.Iterator<ITextComponent> iterator()
iterator
in interface java.lang.Iterable<ITextComponent>
iterator
in class TextComponentBase
public java.lang.String getUnformattedComponentText()
TextComponentString
, but it's the translated text for a TextComponentTranslation
and it's the score value for a TextComponentScore
.public TextComponentTranslation createCopy()
public boolean equals(java.lang.Object p_equals_1_)
equals
in class TextComponentBase
public int hashCode()
hashCode
in class TextComponentBase
public java.lang.String toString()
toString
in class TextComponentBase
public java.lang.String getKey()
public java.lang.Object[] getFormatArgs()