VoxelManip


 * Available in versions 0.4.8+

The Voxel Manipulator can be used to set many nodes in a specified area at once, which is useful to avoid unnecessary calculations. The metas of nodes, if they have one, do not become removed and the on_constructs and on_destructs are ignored.

VoxelManip
It's an interface to the MapVoxelManipulator for Lua, it can be created via VoxelManip or minetest.get_voxel_manip. The usage varies between mapgen and no mapgen, see.

VoxelArea
VoxelArea is a helper class for voxel areas, it can be created via VoxelArea:new{MinEdge=pmin, MaxEdge=pmax}. The coordinates are *inclusive*, like most other things in Minetest

methods:
For more information, have a look at the implementation.

Using offsets
Instead of recalculating the index using area:index or using the area:iter function, to move in specific directions you only need to add a specific number. This is the area:index function: If you have one index given and want to have the index for the position 1m above you don't need to recalculate the whole thing: So if you want to move n meters in x direction: newindex = index + n respectively in y direction: newindex = index + n * area.ystride and in z direction: newindex = index + n * area.zstride n can be negative, of course, but it can't be float, and take care to not leave the area