1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Schematics: Add core.place_schematic_on_vmanip API

Fix memory leak in minetest.place_schematic
Slightly refactor Schematic code
This commit is contained in:
kwolekr 2015-11-04 03:33:12 -05:00
parent 732cabee19
commit 1384108f8c
6 changed files with 112 additions and 19 deletions

View file

@ -2294,6 +2294,15 @@ These functions return the leftover itemstack.
* `replacements` = `{["old_name"] = "convert_to", ...}`
* `force_placement` is a boolean indicating whether nodes other than `air` and
`ignore` are replaced by the schematic
* Returns nil if the schematic could not be loaded.
* `minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement)`:
* This function is analagous to minetest.place_schematic, but places a schematic onto the
specified VoxelManip object `vmanip` instead of the whole map.
* Returns false if any part of the schematic was cut-off due to the VoxelManip not
containing the full area required, and true if the whole schematic was able to fit.
* Returns nil if the schematic could not be loaded.
* After execution, any external copies of the VoxelManip contents are invalidated.
* `minetest.serialize_schematic(schematic, format, options)`
* Return the serialized schematic specified by schematic (see: Schematic specifier)