minetestworld
This crate lets you read Luanti worlds in a low-level way.
Usage
As this crate returns tokio based futures, you have to specify that along the dependencies:
[]
= "0.6.1"
= "1"
With the map block API, you can load chunks from and save them to the map:
For reading and writing individual voxels ("nodes") though, the VoxelManip struct will be more convenient, as the example shows.
An example
Here is an example that reads all nodes of a random chunk ("map block"):
[]
= { = "1", = ["full"] }
= "0.6.1"
= "0.3"
use Error;
use StreamExt;
use ;
async
Selectable features
The Cargo features sqlite, redis, postgres, and leveldb enable the respective map data backend. They are enabled by default and can be selected individually:
[]
= { = "0.6.1", = false, = [ "sqlite" ] }
This crate only compiles if at least one backend is enabled, because it becomes pointless without.
To gain TLS support for the postgres and redis connections, add the tls-rustls or the tls-native-tls feature.
See minetest-worldmapper for a real-world example.