2021-05-28 09:24:10 +02:00
## World Data Manager library for Minetest
2021-05-28 07:12:23 +02:00
### Description:
2021-05-28 09:09:47 +02:00
A [Minetest][] library for managing data files in the world directory.
2021-05-28 07:12:23 +02:00
2021-05-28 09:24:10 +02:00
It takes a little work to read from & write to data in the world directory. `wdata` aims to make that easier by utilizing just two simple methods.
2021-05-28 07:12:23 +02:00
2021-06-15 22:07:02 +02:00
This mod is essentially an alternative to Minetest's built-in [StorageRef][] & was created before I realized the implementation existed. Some may still find wdata useful as it does allow for customizing sub-directories & filenames.
2021-06-15 22:23:21 +02:00
< img src = "screenshot.png" alt = "icon" width = "100px" / >
2021-05-28 07:12:23 +02:00
### Licensing:
2021-06-15 22:23:21 +02:00
- Code: [MIT ](LICENSE.txt )
- Icon: [CC0 ](https://openclipart.org/detail/270878 )
2021-05-28 07:12:23 +02:00
### Usage:
2021-05-28 09:09:47 +02:00
There are two methods:
```
2021-05-28 09:24:10 +02:00
- wdata.read(fname)
2021-05-28 09:09:47 +02:00
- reads json data from file in world directory & converts to a table.
- fname: File basename without suffix (e.g. "my_config" or "my_mod/my_config").
2021-05-28 09:24:10 +02:00
- wdata.write(fname, data[, styled])
2021-05-28 09:09:47 +02:00
- converts table to json data & writes to file in world directory.
- fname: File basename without suffix (e.g. "my_config" or "my_mod/my_config").
- data: Table containing data to be exported.
- styled: Outputs in a human-readable format if this is set (default: true).
```
### Requirements:
```
Depends: none
Optional depends: none
```
2021-05-28 07:12:23 +02:00
### Links
2021-06-15 22:41:17 +02:00
- [![ContentDB ](https://content.minetest.net/packages/AntumDeluge/wdata/shields/title/ )](https://content.minetest.net/packages/AntumDeluge/wdata/)
2021-05-28 09:09:47 +02:00
- [Forum ](https://forum.minetest.net/viewtopic.php?t=26804 )
2021-05-28 09:24:10 +02:00
- [Git repo ](https://github.com/AntumMT/mod-wdata )
2021-08-29 04:44:25 +02:00
- [Reference ](https://antummt.github.io/mod-wdata/docs/reference/ )
2021-05-28 07:12:23 +02:00
- [Changelog ](changelog.txt )
- [TODO ](TODO.txt )
[Minetest]: http://minetest.net/
2021-06-15 22:07:02 +02:00
[StorageRef]: https://github.com/minetest/minetest/blob/c9144ae/doc/lua_api.txt#L6883