Skip to content

Commit

Permalink
Added Get JSON size + Is JSON empty + Bump version (Close #38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldorion committed May 20, 2023
1 parent b945ccd commit b7fc5ea
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 5.6.3
* [#38] Added a Get JSOn size block
* Added Is JSON object empty block

## 5.6.2
* Added 1.19.4 support
* Removed 1.16.5 support
Expand Down
1 change: 1 addition & 0 deletions src/fabric-1.19.2/procedures/get_json_size.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.size()
1 change: 1 addition & 0 deletions src/fabric-1.19.2/procedures/is_json_empty.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.isEmpty()
2 changes: 1 addition & 1 deletion src/fabric-1.19.2/procedures/json_property_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}) != null)
${field$VAR?replace("local:", "")?replace("global:", "")}.has(${input$name})
1 change: 1 addition & 0 deletions src/fabric-1.19.4/procedures/get_json_size.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.size()
1 change: 1 addition & 0 deletions src/fabric-1.19.4/procedures/is_json_empty.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.isEmpty()
2 changes: 1 addition & 1 deletion src/fabric-1.19.4/procedures/json_property_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}) != null)
${field$VAR?replace("local:", "")?replace("global:", "")}.has(${input$name})
1 change: 1 addition & 0 deletions src/forge-1.18.2/procedures/get_json_size.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.size()
1 change: 1 addition & 0 deletions src/forge-1.18.2/procedures/is_json_empty.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.isEmpty()
2 changes: 1 addition & 1 deletion src/forge-1.18.2/procedures/json_property_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}) != null)
${field$VAR?replace("local:", "")?replace("global:", "")}.has(${input$name})
1 change: 1 addition & 0 deletions src/forge-1.19.2/procedures/get_json_size.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.size()
1 change: 1 addition & 0 deletions src/forge-1.19.2/procedures/is_json_empty.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.isEmpty()
2 changes: 1 addition & 1 deletion src/forge-1.19.2/procedures/json_property_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}) != null)
${field$VAR?replace("local:", "")?replace("global:", "")}.has(${input$name})
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/get_json_size.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.size()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/is_json_empty.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.isEmpty()
2 changes: 1 addition & 1 deletion src/forge-1.19.4/procedures/json_property_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}) != null)
${field$VAR?replace("local:", "")?replace("global:", "")}.has(${input$name})
5 changes: 4 additions & 1 deletion src/lang/texts.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ blockly.block.get_game_directory.tooltip=Servers are not supported with Fabric.
blockly.block.get_json_logic=Get JSON logic property %1 of %2
blockly.block.get_json_number=Get JSON number property %1 of %2
blockly.block.get_json_object=Get JSON object property %1 of %2
blockly.block.get_json_size=Get the size of the JSON object %1
blockly.block.get_json_text=Get JSON text property %1 of %2
blockly.block.has_json_member=Does JSON %2 contain member %1
blockly.block.is_json_empty=Is JSON empty %1
blockly.block.move_file=Move %1 to %2
blockly.block.move_file.tooltip=Create a new file like the original and delete the original
blockly.block.number_to_direction=Number %1 to direction
blockly.block.number_to_direction.description=Down: 0, Up: 1, North: 2, South: 3, West: 4 and East: 5
blockly.block.parse_json=Parse JSON %1
blockly.block.path_separator=File path separator
blockly.block.json_property_exists=Does JSON property %1 exists on %2
blockly.block.json_property_exists=Does JSON %1 have %2
blockly.block.read_txt=For each line of %1 get the text as %2 do %3
blockly.block.read_json=Read JSON file %1 as %3 and get values %2
blockly.block.string_iterator=String iterator
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "File Manager",
"description": "Create and read your files",
"author": "Goldorion",
"version": "5.6.2",
"version": "5.6.3",
"updateJSONURL": "https://raw.githubusercontent.com/Goldorion/File-Manager-MCreator/master/update.json",
"pluginPageID": 64638
}
Expand Down
21 changes: 21 additions & 0 deletions src/procedures/get_json_size.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"args0": [
{
"type": "input_dummy",
"name": "var"
}
],
"extensions": [
"jsonobject_variables"
],
"mutator": "variable_entity_input",
"inputsInline": true,
"output": "Number",
"colour": "%{BKY_MATH_HUE}",
"mcreator": {
"toolbox_id": "file_manager",
"fields": [
"VAR"
]
}
}
21 changes: 21 additions & 0 deletions src/procedures/is_json_empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"args0": [
{
"type": "input_dummy",
"name": "var"
}
],
"extensions": [
"jsonobject_variables"
],
"mutator": "variable_entity_input",
"inputsInline": true,
"output": "Boolean",
"colour": "%{BKY_LOGIC_HUE}",
"mcreator": {
"toolbox_id": "file_manager",
"fields": [
"VAR"
]
}
}
2 changes: 1 addition & 1 deletion update.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"file-manager": {
"latest": "5.6.2"
"latest": "5.6.3"
}
}

0 comments on commit b7fc5ea

Please sign in to comment.