fix: TextSerialize
This commit is contained in:
@@ -11,7 +11,7 @@ import mc.core.text.Text;
|
||||
public class TextSerializer {
|
||||
public static JsonObject serialize(Text text) {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("text", text.getString());
|
||||
jsonObject.addProperty("text", text.getContent());
|
||||
|
||||
if (text.getColor() != null) {
|
||||
jsonObject.addProperty("color", text.getColor().getName());
|
||||
@@ -35,9 +35,9 @@ public class TextSerializer {
|
||||
}
|
||||
}
|
||||
|
||||
if (text.getChilds() != null) {
|
||||
if (text.getChildren() != null) {
|
||||
JsonArray extra = new JsonArray();
|
||||
text.getChilds().forEach(child -> extra.add(serialize(child)));
|
||||
text.getChildren().forEach(child -> extra.add(serialize(child)));
|
||||
jsonObject.add("extra", extra);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user