public class WrappedChatComponent extends AbstractWrapper
handle, handleType
Modifier and Type | Method and Description |
---|---|
WrappedChatComponent |
deepClone()
Retrieve a deep copy of the current chat component.
|
boolean |
equals(java.lang.Object obj) |
static WrappedChatComponent[] |
fromChatMessage(java.lang.String message)
Construct an array of chat components from a standard Minecraft message.
|
static WrappedChatComponent |
fromHandle(java.lang.Object handle)
Construct a new chat component wrapper around the given NMS object.
|
static WrappedChatComponent |
fromJson(java.lang.String json)
Construct a new chat component wrapper from the given JSON string.
|
static WrappedChatComponent |
fromText(java.lang.String text)
Construct a wrapper around a new text chat component with the given text.
|
java.lang.String |
getJson()
Retrieve a copy of this component as a JSON string.
|
int |
hashCode() |
void |
setJson(java.lang.String obj)
Set the content of this component using a JSON object.
|
getHandle, getHandleType, setHandle
public static WrappedChatComponent fromHandle(java.lang.Object handle)
handle
- - the NMS object.public static WrappedChatComponent fromJson(java.lang.String json)
json
- - the json.public static WrappedChatComponent fromText(java.lang.String text)
text
- - the text of the text chat component.public static WrappedChatComponent[] fromChatMessage(java.lang.String message)
This uses ChatColor
for formating.
message
- - the message.public java.lang.String getJson()
Note that any modifications to this JSON string will not update the current component.
public void setJson(java.lang.String obj)
obj
- - the JSON that represents the new component.public WrappedChatComponent deepClone()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object