Skip to content

Commit

Permalink
Added 1.19.4, removed 1.16.5 - 5.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldorion committed May 5, 2023
1 parent 7161f6e commit 606a66b
Show file tree
Hide file tree
Showing 66 changed files with 153 additions and 4 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.2
* Added 1.19.4 support
* Removed 1.16.5 support

## 5.6.1
* Updated to MCreator 2023.1.04717
* [#34] Added Chinese translation (Grey-Wind)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ The 2 following examples require File Manager 5.0 or newer.

## Important Information
* You need to use MCreator 2021.3.51219 or a newer version
* This version supports Forge 1.18.2, Forge 1.19.2 and Fabric 1.19.2
* Forge 1.16.5 is included, but it does not receive new features since File Manager 5.5.
* This version supports Forge 1.18.2, 1.19.2 and 1.19.4 and Fabric 1.19.2 and 1.19.4 (when it'll be updated)

## Downloads/Install Instructions
Downloads can be found on the [Release page of this repo](https://github.com/Goldorion/File-Manager-MCreator/releases).
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/fabric-1.19.4/procedures/blockstate_to_string.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<#include "mcitems.ftl">
NbtUtils.writeBlockState(${mappedBlockToBlockStateCode(input$blockstate)}).getAsString()
1 change: 1 addition & 0 deletions src/fabric-1.19.4/procedures/direction_to_number.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$direction}.get3DDataValue()
1 change: 1 addition & 0 deletions src/fabric-1.19.4/procedures/get_game_directory.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minecraft.getInstance().gameDirectory
1 change: 1 addition & 0 deletions src/fabric-1.19.4/procedures/number_to_direction.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Direction.from3DDataValue(${opt.toInt(input$number)})
10 changes: 10 additions & 0 deletions src/fabric-1.19.4/procedures/string_to_blockstate.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*@BlockState*/new Object() {
public BlockState getBlockState(String _nbt) {
try {
return NbtUtils.readBlockState(TagParser.parseTag(_nbt));
} catch (CommandSyntaxException e) {
${JavaModName}.LOGGER.error(e);
return Blocks.AIR.defaultBlockState();
}
}
}.getBlockState(${input$string})
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/forge-1.19.4/mappings/types.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
file: File
jsonobject: com.google.gson.JsonObject
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/add_json_object.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$JOBJVAR?replace("local:", "")?replace("global:", "")}.add(${input$name}, ${field$VAR?replace("local:", "")?replace("global:", "")});
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/add_json_property.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$JOBJVAR?replace("local:", "")?replace("global:", "")}.addProperty(${input$name}, ${input$value});
2 changes: 2 additions & 0 deletions src/forge-1.19.4/procedures/blockstate_to_string.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<#include "mcitems.ftl">
NbtUtils.writeBlockState(${mappedBlockToBlockStateCode(input$blockstate)}).getAsString()
5 changes: 5 additions & 0 deletions src/forge-1.19.4/procedures/copy_file.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
try {
org.apache.commons.io.FileUtils.copyFile(${field$VAR?replace("local:", "")?replace("global:", "")}, new File(${input$toLocation}));
} catch (IOException e) {
${JavaModName}.LOGGER.error(e);
}
6 changes: 6 additions & 0 deletions src/forge-1.19.4/procedures/create_file.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
try {
${field$VAR?replace("local:", "")?replace("global:", "")}.getParentFile().mkdirs();
${field$VAR?replace("local:", "")?replace("global:", "")}.createNewFile();
} catch (IOException exception) {
exception.printStackTrace();
}
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/direction_to_number.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${input$direction}.get3DDataValue()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/file_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.exists()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/file_variable.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
new File(${input$location}, File.separator + ${input$name})
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/get_file_name.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.getName()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/get_json_logic.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}).getAsBoolean()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/get_json_number.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}).getAsDouble()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/get_json_object.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$JOBJVAR?replace("local:", "")?replace("global:", "")}.get(${input$name}).getAsJsonObject()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/get_json_text.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}).getAsString()
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/json_property_exists.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(${field$VAR?replace("local:", "")?replace("global:", "")}.get(${input$name}) != null)
5 changes: 5 additions & 0 deletions src/forge-1.19.4/procedures/move_file.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
try {
org.apache.commons.io.FileUtils.moveFile(${field$VAR?replace("local:", "")?replace("global:", "")}, new File(${input$toLocation}));
} catch (IOException e) {
${JavaModName}.LOGGER.error(e);
}
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/number_to_direction.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Direction.from3DDataValue(${opt.toInt(input$number)})
10 changes: 10 additions & 0 deletions src/forge-1.19.4/procedures/parse_json.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(new Object(){
public JsonObject parse(String rawJson){
try {
return new Gson().fromJson(rawJson, com.google.gson.JsonObject.class);
} catch (Exception e) {
${JavaModName}.LOGGER.error(e);
return new Gson().fromJson("{}", com.google.gson.JsonObject.class);
}
}
}.parse(${input$json}))
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/path_separator.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
File.separator
17 changes: 17 additions & 0 deletions src/forge-1.19.4/procedures/read_json.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(${field$VAR?replace("local:", "")?replace("global:", "")}));
StringBuilder jsonstringbuilder = new StringBuilder();
String line;
while((line = bufferedReader.readLine()) != null) {
jsonstringbuilder.append(line);
}
bufferedReader.close();

${field$JOBJVAR?replace("local:", "")?replace("global:", "")} = new Gson().fromJson(jsonstringbuilder.toString(), com.google.gson.JsonObject.class);
${statement$values}

} catch (IOException e) {
e.printStackTrace();
}
}
10 changes: 10 additions & 0 deletions src/forge-1.19.4/procedures/read_txt.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
try {
BufferedReader ${field$VAR?replace("local:", "")?replace("global:", "")}Reader = new BufferedReader(new FileReader(${field$VAR?replace("local:", "")?replace("global:", "")}));
String stringiterator = "";
while((stringiterator = ${field$VAR?replace("local:", "")?replace("global:", "")}Reader.readLine()) != null) {
${statement$foreach}
}
${field$VAR?replace("local:", "")?replace("global:", "")}Reader.close();
} catch (IOException e) {
e.printStackTrace();
}
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/string_iterator.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stringiterator
10 changes: 10 additions & 0 deletions src/forge-1.19.4/procedures/string_to_blockstate.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*@BlockState*/new Object() {
public BlockState getBlockState(String _nbt) {
try {
return NbtUtils.readBlockState(TagParser.parseTag(_nbt));
} catch (CommandSyntaxException e) {
${JavaModName}.LOGGER.error(e);
return Blocks.AIR.defaultBlockState();
}
}
}.getBlockState(${input$string})
1 change: 1 addition & 0 deletions src/forge-1.19.4/procedures/stringify_json.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${field$JOBJVAR?replace("local:", "")?replace("global:", "")}.toString()
5 changes: 5 additions & 0 deletions src/forge-1.19.4/procedures/url_to_file.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
try {
FileUtils.copyURLToFile(new URL(${url}), ${field$VAR?replace("local:", "")?replace("global:", "")}, ${input$connectionTimeout}, ${input$readTimeout);
} catch (IOException e) {
e.printStackTrace();
}
11 changes: 11 additions & 0 deletions src/forge-1.19.4/procedures/write_json.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
Gson mainGSONBuilderVariable = new GsonBuilder().setPrettyPrinting().create();

try {
FileWriter fileWriter = new FileWriter(${field$VAR?replace("local:", "")?replace("global:", "")});
fileWriter.write(mainGSONBuilderVariable.toJson(${field$JOBJVAR?replace("local:", "")?replace("global:", "")}));
fileWriter.close();
} catch (IOException exception) {
exception.printStackTrace();
}
}
6 changes: 6 additions & 0 deletions src/forge-1.19.4/procedures/write_line.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
${field$VAR?replace("local:", "")?replace("global:", "")}bw.write(${input$text});
<#if input$newLine == "(true)">
${field$VAR?replace("local:", "")?replace("global:", "")}bw.newLine();
</#if>
}
11 changes: 11 additions & 0 deletions src/forge-1.19.4/procedures/write_txt.java.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
try {
FileWriter ${field$VAR?replace("local:", "")?replace("global:", "")}writer = new FileWriter(${field$VAR?replace("local:", "")?replace("global:", "")});
BufferedWriter ${field$VAR?replace("local:", "")?replace("global:", "")}bw = new BufferedWriter(${field$VAR?replace("local:", "")?replace("global:", "")}writer);

${statement$text}

${field$VAR?replace("local:", "")?replace("global:", "")}bw.close();
${field$VAR?replace("local:", "")?replace("global:", "")}writer.close();
} catch (IOException exception) {
exception.printStackTrace();
}
10 changes: 10 additions & 0 deletions src/forge-1.19.4/variables/file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
defaultvalue: new File("")
scopes:
local:
init: ${var.getType().getJavaType(generator.getWorkspace())} ${var.getName()} = ${var.getType().getDefaultValue(generator.getWorkspace())};
get: ${name}
set: ${name} = ${opt.removeParentheses(value)};
global_session:
init: public static File ${var.getName()} = ${var.getValue()};
get: ${JavaModName}Variables.${name}
set: ${JavaModName}Variables.${name} = ${opt.removeParentheses(value)};
6 changes: 6 additions & 0 deletions src/forge-1.19.4/variables/jsonobject.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
defaultvalue: new com.google.gson.JsonObject()
scopes:
local:
init: ${var.getType().getJavaType(generator.getWorkspace())} ${var.getName()} = ${var.getType().getDefaultValue(generator.getWorkspace())};
get: ${name}
set: ${name} = ${opt.removeParentheses(value)};
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.1",
"version": "5.6.2",
"updateJSONURL": "https://raw.githubusercontent.com/Goldorion/File-Manager-MCreator/master/update.json",
"pluginPageID": 64638
}
Expand Down
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.1"
"latest": "5.6.2"
}
}

0 comments on commit 606a66b

Please sign in to comment.