aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-04-16 04:12:26 -0400
committerkwolekr <kwolekr@minetest.net>2015-04-16 16:27:05 -0400
commit479f38973e13680d6a39d9c2a7f29fd330b67d41 (patch)
treec6719cf37bfbc44f98cc33b9b2693542b8fdd8cc /doc
parent0c634a97197d50f2ca58825f1b215d0407397ac6 (diff)
downloadminetest-479f38973e13680d6a39d9c2a7f29fd330b67d41.tar.gz
minetest-479f38973e13680d6a39d9c2a7f29fd330b67d41.tar.bz2
minetest-479f38973e13680d6a39d9c2a7f29fd330b67d41.zip
Schematics: Refactor NodeResolver and add NodeResolveMethod
NodeResolver name lists now belong to the NodeResolver object instead of the associated NodeDefManager. In addition to minimizing unnecessary abstraction and overhead, this move permits NodeResolvers to look up nodes that they had previously set pending for resolution. So far, this functionality has been used in the case of schematics for serialization/deserialization.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 25f9d53ca..a7fcaeab1 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2170,14 +2170,23 @@ These functions return the leftover itemstack.
* `force_placement` is a boolean indicating whether nodes other than `air` and
`ignore` are replaced by the schematic
-* `minetest.serialize_schematic(schematic, format, use_comments)`
+* `minetest.serialize_schematic(schematic, format, options)`
* Return the serialized schematic specified by schematic (see: Schematic specifier)
* in the `format` of either "mts" or "lua".
* "mts" - a string containing the binary MTS data used in the MTS file format
* "lua" - a string containing Lua code representing the schematic in table format
- * If `use_comments` is true, the Lua code generated will have (X, Z) position comments
- * for every X row generated in the schematic data for easier reading. This parameter
- * is ignored if `format` is not "lua".
+ * `options` is a table containing the following optional parameters:
+ * If `use_comments` is true and `format` is "lua", the Lua code generated will have (X, Z)
+ * position comments for every X row generated in the schematic data for easier reading.
+ * If `register_after_load` is true, then `schematic`, if not yet loaded, will be registered
+ * after loading and persist in memory.
+ * node_resolve_method can be one of either "none", "direct", or "deferred" (default: "none")
+ * This sets the way method by with node names are mapped to their content IDs, if loaded:
+ * "none" performs no node resolution and preserves all node names from the schematic definition
+ * "direct" performs an immediate lookup of content ID, given all the nodes that have been
+ * registered up to this point in script execution
+ * "deferred" pends node resolution until after the script registration phase has ended
+ * In practice, it is recommended to use "none" in nearly all use cases.
### Misc.
* `minetest.get_connected_players()`: returns list of `ObjectRefs`