Hey, everyone. I was recently working on a client mod that exports information from the game, like player information, bag items, toolbelt items, etc. I primarily created it so I can feed the exported information back into a simple AI-powered (OpenAI + ElevenLabs) voice assistant I created for myself because I sometimes feel lonely while playing single-player. I needed a way to get the item and block names for the things inside the bag and the toolbelt. I looked online and didn't really find many resources. I kept digging into the API and eventually came across `IApplication.GetBlockAndItemMapping`, but unfortunately, it doesn't work for client mods (at least, that's what I figured out after it kept throwing errors; maybe I was using it wrong). I eventually realised that I can get the item names (and a lot of other things) from the `.ecf` files. I took a look at them, and they seemed to use a weird format. So, I used an AI to analyse the structure of these files, and then handwrote a parser that parses all of the bundled `.ecf` files without any issues; not only that, I wrote a CLI that can convert the parsed files into JSON so they are easier to work with. I still have not implemented a "deparser" because I don't really want to waste the rest of my weekend. I tend to spend hours going down rabbit holes, lol. Here is a video showing the CLI in action, parsing & converting all 633 bundled `.ecf` files successfully to pretty-printed JSON. Would you be interested in using this tool? I also plan to add YAML and potentially an SQLite conversion option. UPDATE: You can find the library and CLI projects here on GitHub
Update: weekend wasted successfully I have implemented a tonne of optimisations and a JSON-to-ECF converter! Here is another video showcasing the ECF-to-JSON-to-ECF conversion! The cool thing is, I tested running the game using the files that were generated by my tool, and it runs flawlessly! I will be releasing the source code on GitHub shortly, and I will set up automated publishing for Windows, macOS, and Linux later.