From c610643c4ca1d1c32ca3e400b5cb055f25401107 Mon Sep 17 00:00:00 2001 From: paramat Date: Fri, 23 Feb 2018 13:42:48 +0000 Subject: Place schematic (on vmanip): Enable use of 'place center' flags For 'place schematic' and 'place schematic on vmanip' APIs. Fix 'place center' code to properly centre schematics. Fix some comments. --- doc/lua_api.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 962a56e10..29be2a98c 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -3276,7 +3276,7 @@ These functions return the leftover itemstack. * If slice probability list equals `nil`, no slice probabilities are applied. * Saves schematic in the Minetest Schematic format to filename. -* `minetest.place_schematic(pos, schematic, rotation, replacements, force_placement)` +* `minetest.place_schematic(pos, schematic, rotation, replacements, force_placement, flags)` * Place the schematic specified by schematic (see: Schematic specifier) at `pos`. * `rotation` can equal `"0"`, `"90"`, `"180"`, `"270"`, or `"random"`. * If the `rotation` parameter is omitted, the schematic is not rotated. @@ -3288,14 +3288,22 @@ These functions return the leftover itemstack. will always use the cached version and the replacement list defined for it, regardless of whether the file or the replacement list parameter have changed. The only way to load the file anew is to restart the server. + * `flags` is a flag field with the available flags: + * place_center_x + * place_center_y + * place_center_z -* `minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement)`: +* `minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement, flags)`: * This function is analogous 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. + * `flags` is a flag field with the available flags: + * place_center_x + * place_center_y + * place_center_z * `minetest.serialize_schematic(schematic, format, options)` * Return the serialized schematic specified by schematic (see: Schematic specifier) -- cgit v1.2.3