summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-01-30 00:30:02 +0100
committerGitHub <noreply@github.com>2018-01-30 00:30:02 +0100
commit584d00a01c4bcd359cc3e585dbcab5cada662348 (patch)
tree4105f4d31e743ac808de40386271b9f331f1dcb5 /doc
parent3b4df956b171385f5c50be48718b900375f3040d (diff)
downloadminetest-584d00a01c4bcd359cc3e585dbcab5cada662348.tar.gz
minetest-584d00a01c4bcd359cc3e585dbcab5cada662348.tar.bz2
minetest-584d00a01c4bcd359cc3e585dbcab5cada662348.zip
Add minetest.bulk_set_node call + optimize Environment::set_node call (#6958)
* Add minetest.bulk_set_node call + experimental mod unittest * Optimize set_node function to prevent triple lookup on contentfeatures Do only one lookup for old, and try to merge old and new lookup if node is same than previous node * Add benchmark function + optimize vector population to have real results
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 27620aa8f..afeb53cd6 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2749,6 +2749,15 @@ and `minetest.auth_reload` call the authentication handler.
* `node`: table `{name=string, param1=number, param2=number}`
* If param1 or param2 is omitted, it's set to `0`.
* e.g. `minetest.set_node({x=0, y=10, z=0}, {name="default:wood"})`
+* `minetest.bulk_set_node({pos1, pos2, pos3, ...}, node)`
+ * Set node on all positions set in the first argument.
+ * e.g. `minetest.bulk_set_node({{x=0, y=1, z=1}, {x=1, y=2, z=2}}, {name="default:stone"})`
+ * For node specification or position syntax see `minetest.set_node` call
+ * Faster than set_node due to single call, but still considerably slower than
+ Voxel Manipulators (LVM) for large numbers of nodes.
+ Unlike LVMs, this will call node callbacks. It also allows setting nodes in spread out
+ positions which would cause LVMs to waste memory.
+ For setting a cube, this is 1.3x faster than set_node whereas LVM is 20x faster.
* `minetest.swap_node(pos, node)`
* Set node at position, but don't remove metadata
* `minetest.remove_node(pos)`