hugeblank / allium

Lua script loader and API for easy Minecraft modding
MIT License
41 stars 8 forks source link

Persistence & Config API #26

Closed hugeblank closed 2 years ago

hugeblank commented 2 years ago

With BlanketCon coming up, I thought it would be cool to create a script that offers a warp system, in the event that it's not already provided by another mod. Regardless of that, I realized that I couldn't do it if I wanted to. I'd need a way to save the warp coordinates/dimension.

I'm also adding config to this issue because they both have to do with reading/writing data external to script stuff. The API would ideally be able to handle optional values, as well as fix invalid values in a config file without overwriting it completely. Config files would be found in config/allium/<script_id>.json.

Persistence would be a bit more complicated than this. Ideally it would be a drop-in replacement of the io API, sandboxed within the directory the script is in.

This entire concept is up for discussion.

hugeblank commented 2 years ago

c3b7715d373d424aa3f41bc1d80307912859e09d introduces the fs API, and more important to this issue, fs.open.