]> git.lizzy.rs Git - minetest.git/blobdiff - doc/lua_api.txt
Add missing documentation of automatic_face_movement_max_rotation_per_sec entity...
[minetest.git] / doc / lua_api.txt
index 11f90ba037840192c2f1f2a540557f0d95d66f7e..b713b68bf1ee2bbf7f6ca3cc2379dabc1b40f749 100644 (file)
@@ -763,7 +763,7 @@ Creates veins of ore varying in density by according to the intersection of two
 instances of 3d perlin noise with diffferent seeds, both described by
 `noise_params`.  `random_factor` varies the influence random chance has on
 placement of an ore inside the vein, which is `1` by default. Note that
-modifying this parameter may require adjusting `noise_threshhold`.
+modifying this parameter may require adjusting `noise_threshold`.
 The parameters `clust_scarcity`, `clust_num_ores`, and `clust_size` are ignored
 by this ore type.  This ore type is difficult to control since it is sensitive
 to small changes.  The following is a decent set of parameters to work from:
@@ -777,7 +777,7 @@ to small changes.  The following is a decent set of parameters to work from:
            persist = 0.5,
            flags = "eased",
        },
-       noise_threshhold = 1.6
+       noise_threshold = 1.6
 
 WARNING:  Use this ore type *very* sparingly since it is ~200x more
 computationally expensive than any other ore.
@@ -1305,10 +1305,12 @@ mentioned in "Nodes". However, it is possible to insert extra data into a
 node. It is called "node metadata"; See "`NodeMetaRef`".
 
 Metadata contains two things:
+
 * A key-value store
 * An inventory
 
 Some of the values in the key-value store are handled specially:
+
 * `formspec`: Defines a right-click inventory menu. See "Formspec".
 * `infotext`: Text shown on the screen when the node is pointed at
 
@@ -1921,7 +1923,11 @@ Call these functions only at load time!
     * Should be called by the authentication handler if privileges changes.
     * To report everybody, set `name=nil`.
 * `minetest.get_password_hash(name, raw_password)`
-    * Convert a name-password pair to a password hash that Minetest can use
+    * Convert a name-password pair to a password hash that Minetest can use.
+    * The returned value alone is not a good basis for password checks based
+    * on comparing the password hash in the database with the password hash
+    * from the function, with an externally provided password, as the hash
+    * in the db might use the new SRP verifier format.
 * `minetest.string_to_privs(str)`: returns `{priv1=true,...}`
 * `minetest.privs_to_string(privs)`: returns `"priv1,priv2,..."`
     * Convert between two privilege representations
@@ -2538,6 +2544,19 @@ This is basically a reference to a C++ `ServerActiveObject`
 * `set_properties(object property table)`
 * `get_properties()`: returns object property table
 * `is_player()`: returns true for players, false otherwise
+* `get_nametag_attributes()`
+    * returns a table with the attributes of the nametag of an object
+    * {
+        color = {a=0..255, r=0..255, g=0..255, b=0..255},
+        text = "",
+      }
+* `set_nametag_attributes(attributes)`
+    * sets the attributes of the nametag of an object
+    * `attributes`:
+      {
+        color = ColorSpec,
+        text = "My Nametag",
+      }
 
 ##### LuaEntitySAO-only (no-op for other objects)
 * `setvelocity({x=num, y=num, z=num})`
@@ -2638,17 +2657,6 @@ This is basically a reference to a C++ `ServerActiveObject`
     * in first person view
     * in third person view (max. values `{x=-10/10,y=-10,15,z=-5/5}`)
 * `get_eye_offset()`: returns offset_first and offset_third
-* `get_nametag_attributes()`
-    * returns a table with the attributes of the nametag of the player
-    * {
-        color = {a=0..255, r=0..255, g=0..255, b=0..255},
-      }
-* `set_nametag_attributes(attributes)`
-    * sets the attributes of the nametag of the player
-    * `attributes`:
-      {
-        color = ColorSpec,
-      }
 
 ### `InvRef`
 An `InvRef` is a reference to an inventory.
@@ -2934,6 +2942,7 @@ core.CONTENT_IGNORE  (ID for "ignore" nodes)
 Inside of `on_generated()` callbacks, it is possible to retrieve the same VoxelManip object used by the
 core's Map Generator (commonly abbreviated Mapgen).  Most of the rules previously described still apply
 but with a few differences:
+
 * The Mapgen VoxelManip object is retrieved using: `minetest.get_mapgen_object("voxelmanip")`
 * This VoxelManip object already has the region of map just generated loaded into it; it's not necessary
   to call `VoxelManip:read_from_map()` before using a Mapgen VoxelManip.
@@ -2992,7 +3001,7 @@ will place the schematic inside of the VoxelManip.
 * `update_map()`: Update map after writing chunk back to map.
     * To be used only by `VoxelManip` objects created by the mod itself;
       not a `VoxelManip` that was retrieved from `minetest.get_mapgen_object`
-* `set_lighting(light, p1, p2)`: Set the lighting within the `VoxelManip` to a uniform value
+* `set_lighting(light, [p1, p2])`: Set the lighting within the `VoxelManip` to a uniform value
     * `light` is a table, `{day=<0...15>, night=<0...15>}`
     * To be used only by a `VoxelManip` object from `minetest.get_mapgen_object`
     * (`p1`, `p2`) is the area in which lighting is set;
@@ -3006,10 +3015,12 @@ will place the schematic inside of the VoxelManip.
     * expects lighting data in the same format that `get_light_data()` returns
 * `get_param2_data()`: Gets the raw `param2` data read into the `VoxelManip` object
 * `set_param2_data(param2_data)`: Sets the `param2` contents of each node in the `VoxelManip`
-* `calc_lighting(p1, p2)`:  Calculate lighting within the `VoxelManip`
+* `calc_lighting([p1, p2], [propagate_shadow])`:  Calculate lighting within the `VoxelManip`
     * To be used only by a `VoxelManip` object from `minetest.get_mapgen_object`
     * (`p1`, `p2`) is the area in which lighting is set; defaults to the whole area
-      if left out
+      if left out or nil
+    * `propagate_shadow` is an optional boolean deciding whether shadows in a generated
+      mapchunk above are propagated down into the mapchunk; defaults to `true` if left out
 * `update_liquids()`: Update liquid flow
 * `was_modified()`: Returns `true` or `false` if the data in the voxel manipulator
   had been modified since the last read from map, due to a call to
@@ -3222,7 +3233,11 @@ Definition tables
         stepheight = 0,
         automatic_face_movement_dir = 0.0,
     --  ^ automatically set yaw to movement direction; offset in degrees; false to disable
+        automatic_face_movement_max_rotation_per_sec = -1,
+    --  ^ limit automatic rotation to this value in degrees per second. values < 0 no limit
         backface_culling = true, -- false to disable backface_culling for model
+        nametag = "", -- by default empty, for players their name is shown if empty
+        nametag_color = <color>, -- sets color of nametag as ColorSpec
     }
 
 ### Entity definition (`register_entity`)
@@ -3568,7 +3583,7 @@ Definition tables
         y_max = 64,
         flags = "",
     --  ^ Attributes for this ore generation
-        noise_threshhold = 0.5,
+        noise_threshold = 0.5,
     --  ^ If noise is above this threshold, ore is placed.  Not needed for a uniform distribution
         noise_params = {offset=0, scale=1, spread={x=100, y=100, z=100}, seed=23, octaves=3, persist=0.70}
     --  ^ NoiseParams structure describing the perlin noise used for ore distribution.