User talk:Afflatus

From Minetest Developer Wiki
Jump to navigation Jump to search

find_nodes_in_area_under_air

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L2070

---

"should return the leftover itemstack (if nil, no item is removed) " http://dev.minetest.net/minetest.register_craftitem#Callbacks https://github.com/minetest/minetest_game/pull/1173 https://github.com/minetest/minetest/blob/fa0bbbf96df17f0d7911274ea85e5c049c20d07b/doc/lua_api.txt#L3466 https://github.com/minetest/minetest/blob/fa0bbbf96df17f0d7911274ea85e5c049c20d07b/doc/lua_api.txt#L3625

---

+* `vector.random2d()` : returns a new normalized 2d vector with random values
+* `vector.random3d()` : returns a new normalized 3d vector with random values
+* `vector.set_length(v, l)` : returns a vector with a specific length (magnitude)
+* `vector.limit(v, l)` : limits the length of a vector
+* `vector.dot(v1, v2)` : returns the dot product of two vectors
+* `vector.cross(v1, v2)` : returns the cross product of two vectors
+* `vector.scalar_triple(v1, v2, v3)` : returns the scalar triple product of three vectors
+* `vector.vector_triple(v1, v2, v3)` : returns the vector triple product of three vectors
+* `vector.angle_between(v1, v2)` : returns the angle between two 2d vectors (x,z) in radians
+* `vector.yaw(v)` : returns yaw from a 2d vector (x, z) in radians

---

+* `string:toarray()`
+    * returns an array, every character is one element
+    * e.g. `("foo"):toarray()[3] == "o"`
+    * should work faster than gmatch
+* string indexing
+    * if the index is an integer, the character at index or nil is returned
+    * e.g. `("foo")[1] == "f"`

---

+    * Check recipe table syntax for different types below.
+* `minetest.clear_craft(recipe)`
+    * Will erase existing craft based either on output item or on input recipe.
+    * Specify either output or input only. If you specify both, input will be ignored. For input use a same recipe table
+      syntax as for `minetest.register_craft(recipe)`. For output specify only item, but not a quantity.
+    * If there is no erase candidate founded, Lua exception will be thrown.
+    * Warning! Type field ("shaped","cooking" or any other) will be ignored if recipe 
+      contain output. Will be erased all possible crafting recipe independent from crafting method.

---

  1. 4309