Skip to content

Commit

Permalink
Add meta for s@script.to_json
Browse files Browse the repository at this point in the history
My bad
  • Loading branch information
mcmonkey4eva committed Nov 3, 2014
1 parent 24513dd commit 2180771
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dScript.java
Expand Up @@ -451,6 +451,13 @@ else return new Element(TagManager.tag(attribute.getScriptEntry() == null ? null
return new Element(getObjectType()).getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <s@script.to_json>
// @returns Element
// @description
// Converts the YAML Script Container to a JSON array.
// Best used with 'yaml data' type scripts.
// -->
if (attribute.startsWith("to_json")) {
JSONObject jsobj = new JSONObject(container.getConfigurationSection("").getMap());
jsobj.remove("TYPE");
Expand Down

0 comments on commit 2180771

Please sign in to comment.