The plugin continues its journey here.
File Manager is a plugin adding new procedure blocks allowing you to create and read your files!
File Types
- JSON
- TXT (simple file reader/writer)
- ZIP (5.7+)
Important Information
- This version supports Forge 1.19.4 and 1.20.1 and Fabric 1.20.1
The 2 following examples require File Manager 5.0 or after.
Create a JSON file
Read a JSON file
I made a tutorial covering this here.
Credits/License
Tutorial on sub-JSON objects by NorthWestTrees
Icon by Tobi-Wan#0482
Licensed under the GNU Lesser General Public License, version 2.1
- Appropriate credit must be provided to the creators and maintainers of this plugin.
- Forked versions of this plugin must be distributed under the same license as this with attribution if distributed.
- Changes must be stated if any modified works are to be distributed.
- Under no circumstances you can state that the original creator endorses modified works.
Changelog
To see a complete changelog of the plugin, check this file.
5.10
* [#48] Add a new parameter to write lines at the end of TXT files
* Note: Existing workspaces will get a build error due to the missing parameter. Previous behaviour was FALSE.
* [Bugfix #62] Write Json object caused a build error due to a missing import (again)
5.9.1
* [Bugfix #61] Some procedure blocks could cause build errors due to a missing import
* Added Persian language support
5.9
* Updated to MCreator 2024.1.15713
* Added support for NeoForge 1.20.4
Comments
Here's the generated code, "flagbw.write" doesn't look right:
public static void executeProcedure(Map<String, Object> dependencies) {
String flagname = "";
boolean flagset = false;
File file = new File("");
file = (File) new File((FMLPaths.GAMEDIR.get().toString() + "/config/"), File.separator + "flags.properties");
if (!file.exists()) {
try {
file.getParentFile().mkdirs();
file.createNewFile();
} catch (IOException exception) {
exception.printStackTrace();
}
{
filebw.write("chicken=true");
filebw.newLine();
}
{
filebw.write("pig=true");
filebw.newLine();
}
{
filebw.write("cow=false");
filebw.newLine();
}
}
Hey, this is sooo helpful. I was thinking that with the new command system, this would be even more useful in conjunction with commands. Could you add a command parameter like "file" or something, kind of like the parameter from the /datapack command. I know there are a few difficulties with that, but see what you think!
I think it might be due to some kind of syntax error, it keeps just putting "file" in front of bw.write without anything else (making "filebw.write" which doesn't seem to make sense). Also java.io.FileWriter; and java.io.BufferedWriter; aren't in the imports, but I'm not sure if that could be a problem.