X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=doc%2Flua_api.txt;h=a01e728891b0a88a621cdec4c9d21bb12548ea88;hb=65c09a96f41705bb8e75fc5ff4276342be91ed11;hp=65af515788b3faf42cbf66959c1aeb7180439dbe;hpb=3ce6642a26d43fd368c24cdfc5460557258fb44f;p=minetest.git diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 65af51578..a01e72889 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -617,6 +617,18 @@ A nodebox is defined as any of: wall_bottom = box, wall_side = box } + { + -- A node that has optional boxes depending on neighbouring nodes' + -- presence and type. See also `connects_to`. + type = "connected", + fixed = box OR {box1, box2, ...} + connect_top = box OR {box1, box2, ...} + connect_bottom = box OR {box1, box2, ...} + connect_front = box OR {box1, box2, ...} + connect_left = box OR {box1, box2, ...} + connect_back = box OR {box1, box2, ...} + connect_right = box OR {box1, box2, ...} + } A `box` is defined as: @@ -1676,16 +1688,15 @@ or string form, a ColorString (defined above): `colorspec = "green"` Spatial Vectors --------------- - -* `vector.new([x[, y, z]])`: returns a vector. - * `x` is a table or the `x` position. - +--------------- +* `vector.new(a[, b, c])`: returns a vector: + * A copy of `a` if `a` is a vector. + * `{x = a, y = b, z = c}`, if all `a, b, c` are defined * `vector.direction(p1, p2)`: returns a vector * `vector.distance(p1, p2)`: returns a number * `vector.length(v)`: returns a number * `vector.normalize(v)`: returns a vector -* `vector.round(v)`: returns a vector +* `vector.round(v)`: returns a vector, each dimension rounded to floor * `vector.apply(v, func)`: returns a vector * `vector.equals(v1, v2)`: returns a boolean @@ -1697,7 +1708,7 @@ For the following functions `x` can be either a vector or a number: * `vector.divide(v, x)`: returns a scaled vector or Schur quotient Helper functions ------------------ +---------------- * `dump2(obj, name="_", dumped={})` * Return object serialized as a string, handles reference loops * `dump(obj, dumped={})` @@ -1998,6 +2009,8 @@ and `minetest.auth_reload` call the authetification handler. * `val` is between `0` and `1`; `0` for midnight, `0.5` for midday * `minetest.get_timeofday()` * `minetest.get_gametime()`: returns the time, in seconds, since the world was created +* `minetest.get_day_count()`: returns number days elapsed since world was created, + * accounting for time changes. * `minetest.find_node_near(pos, radius, nodenames)`: returns pos or `nil` * `radius`: using a maximum metric * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"` @@ -3459,6 +3472,12 @@ Definition tables light_source = 0, -- Amount of light emitted by node damage_per_second = 0, -- If player is inside node, this damage is caused node_box = {type="regular"}, -- See "Node boxes" + connects_to = nodenames, --[[ + * Used for nodebox nodes with the type == "connected" + * Specifies to what neighboring nodes connections will be drawn + * e.g. `{"group:fence", "default:wood"}` or `"default:stone"` ]] + connect_sides = { "top", "bottom", "front", "left", "back", "right" }, --[[ + ^ Tells connected nodebox nodes to connect only to these sides of this node. ]] mesh = "model", selection_box = {type="regular"}, -- See "Node boxes" --[[ ^ If drawtype "nodebox" is used and selection_box is nil, then node_box is used. ]]