Archived
0

fix: TextSerialize

This commit is contained in:
2018-06-14 10:35:21 +03:00
parent e777b8f518
commit 250e513bd2

View File

@@ -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);
}