public class ChatComponentTranslation extends ChatComponentStyle
IChatComponent.Serializer
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<IChatComponent> |
children |
private java.lang.Object[] |
formatArgs |
private java.lang.String |
key |
private long |
lastTranslationUpdateTimeInMilliseconds |
static java.util.regex.Pattern |
stringVariablePattern |
private java.lang.Object |
syncLock |
siblings
Constructor and Description |
---|
ChatComponentTranslation(java.lang.String translationKey,
java.lang.Object... args) |
Modifier and Type | Method and Description |
---|---|
ChatComponentTranslation |
createCopy()
Creates a copy of this component.
|
(package private) void |
ensureInitialized()
ensures that our children are initialized from the most recent string translation mapping.
|
boolean |
equals(java.lang.Object p_equals_1_) |
java.lang.Object[] |
getFormatArgs() |
private IChatComponent |
getFormatArgumentAsComponent(int index) |
java.lang.String |
getKey() |
java.lang.String |
getUnformattedTextForChat()
Gets the text of this component, without any special formatting codes added, for chat.
|
int |
hashCode() |
protected void |
initializeFromFormat(java.lang.String format)
initializes our children from a format string, using the format args to fill in the placeholder variables.
|
java.util.Iterator<IChatComponent> |
iterator() |
IChatComponent |
setChatStyle(ChatStyle style) |
java.lang.String |
toString() |
appendSibling, appendText, createDeepCopyIterator, getChatStyle, getFormattedText, getSiblings, getUnformattedText
private final java.lang.String key
private final java.lang.Object[] formatArgs
private final java.lang.Object syncLock
private long lastTranslationUpdateTimeInMilliseconds
java.util.List<IChatComponent> children
public static final java.util.regex.Pattern stringVariablePattern
public ChatComponentTranslation(java.lang.String translationKey, java.lang.Object... args)
void ensureInitialized()
protected void initializeFromFormat(java.lang.String format)
private IChatComponent getFormatArgumentAsComponent(int index)
public IChatComponent setChatStyle(ChatStyle style)
setChatStyle
in interface IChatComponent
setChatStyle
in class ChatComponentStyle
public java.util.Iterator<IChatComponent> iterator()
iterator
in interface java.lang.Iterable<IChatComponent>
iterator
in class ChatComponentStyle
public java.lang.String getUnformattedTextForChat()
public ChatComponentTranslation createCopy()
public boolean equals(java.lang.Object p_equals_1_)
equals
in class ChatComponentStyle
public int hashCode()
hashCode
in class ChatComponentStyle
public java.lang.String toString()
toString
in class ChatComponentStyle
public java.lang.String getKey()
public java.lang.Object[] getFormatArgs()