Skip to content

Commit

Permalink
Added CompoundNBT to the JSON serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Nov 15, 2020
1 parent 9f22994 commit 12596b1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ public class JSONSerializableDataHandler {
}
return ingredient;
});
map(CompoundNBT.class, type -> new JsonPrimitive(type.toString()), element -> {
try {
return JsonToNBT.getTagFromJson(element.getAsString());
} catch (CommandSyntaxException e) {
Titanium.LOGGER.catching(e);
}
return new CompoundNBT();
});
}

public static <T> void map(Class<T> type, Writer<T> writer, Reader<T> reader) {
Expand Down

0 comments on commit 12596b1

Please sign in to comment.