Skip to content

Commit af07343

Browse files
authoredDec 10, 2020
Various documentation fixes (#10692)
set_sky: New feature, keep note about the old syntax get_us_time: Document overflow localplayer: Document "nil" behaviour before initialization collision_box: Safe limit of "1.45"
1 parent 6d7067f commit af07343

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed
 

‎doc/client_lua_api.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ Please do not try to access the reference until the camera is initialized, other
10011001

10021002
### LocalPlayer
10031003
An interface to retrieve information about the player.
1004+
This object will only be available after the client is initialized. Earlier accesses will yield a `nil` value.
10041005

10051006
Methods:
10061007

‎doc/lua_api.txt

+18-2
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,9 @@ A box of a regular node would look like:
12471247

12481248
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
12491249

1250+
To avoid collision issues, keep each value within the range of +/- 1.45.
1251+
This also applies to leveled nodeboxes, where the final height shall not
1252+
exceed this soft limit.
12501253

12511254

12521255

@@ -3234,6 +3237,7 @@ Helper functions
32343237
* returns true when the passed number represents NaN.
32353238
* `minetest.get_us_time()`
32363239
* returns time with microsecond precision. May not return wall time.
3240+
* This value might overflow on certain 32-bit systems!
32373241
* `table.copy(table)`: returns a table
32383242
* returns a deep copy of `table`
32393243
* `table.indexof(list, val)`: returns the smallest numerical index containing
@@ -6425,6 +6429,8 @@ object you are working with still exists.
64256429
* `selected_mode` is the mode index to be selected after modes have been changed
64266430
(0 is the first mode).
64276431
* `set_sky(sky_parameters)`
6432+
* The presence of the function `set_sun`, `set_moon` or `set_stars` indicates
6433+
whether `set_sky` accepts this format. Check the legacy format otherwise.
64286434
* `sky_parameters` is a table with the following optional fields:
64296435
* `base_color`: ColorSpec, changes fog in "skybox" and "plain".
64306436
* `type`: Available types:
@@ -6466,6 +6472,15 @@ object you are working with still exists.
64666472
abides by, `"custom"` uses `sun_tint` and `moon_tint`, while
64676473
`"default"` uses the classic Minetest sun and moon tinting.
64686474
Will use tonemaps, if set to `"default"`. (default: `"default"`)
6475+
* `set_sky(base_color, type, {texture names}, clouds)`
6476+
* Deprecated. Use `set_sky(sky_parameters)`
6477+
* `base_color`: ColorSpec, defaults to white
6478+
* `type`: Available types:
6479+
* `"regular"`: Uses 0 textures, `bgcolor` ignored
6480+
* `"skybox"`: Uses 6 textures, `bgcolor` used
6481+
* `"plain"`: Uses 0 textures, `bgcolor` used
6482+
* `clouds`: Boolean for whether clouds appear in front of `"skybox"` or
6483+
`"plain"` custom skyboxes (default: `true`)
64696484
* `get_sky()`: returns base_color, type, table of textures, clouds.
64706485
* `get_sky_color()`: returns a table with the `sky_color` parameters as in
64716486
`set_sky`.
@@ -7346,6 +7361,7 @@ Used by `minetest.register_node`.
73467361
leveled_max = 127,
73477362
-- Maximum value for `leveled` (0-127), enforced in
73487363
-- `minetest.set_node_level` and `minetest.add_node_level`.
7364+
-- Values above 124 might causes collision detection issues.
73497365

73507366
liquid_range = 8, -- Number of flowing nodes around source (max. 8)
73517367

@@ -7373,6 +7389,7 @@ Used by `minetest.register_node`.
73737389
type = "fixed",
73747390
fixed = {
73757391
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
7392+
-- Node box format: see [Node boxes]
73767393
},
73777394
},
73787395
-- Custom selection box definition. Multiple boxes can be defined.
@@ -7383,13 +7400,12 @@ Used by `minetest.register_node`.
73837400
type = "fixed",
73847401
fixed = {
73857402
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
7403+
-- Node box format: see [Node boxes]
73867404
},
73877405
},
73887406
-- Custom collision box definition. Multiple boxes can be defined.
73897407
-- If "nodebox" drawtype is used and collision_box is nil, then node_box
73907408
-- definition is used for the collision box.
7391-
-- Both of the boxes above are defined as:
7392-
-- {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from node center.
73937409

73947410
-- Support maps made in and before January 2012
73957411
legacy_facedir_simple = false,

‎games/devtest/mods/testnodes/nodeboxes.lua

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ minetest.register_node("testnodes:nodebox_fixed", {
1818

1919
-- 50% higher than a regular node
2020
minetest.register_node("testnodes:nodebox_overhigh", {
21-
description = S("Overhigh Nodebox Test Node"),
21+
description = S("+50% high Nodebox Test Node"),
2222
tiles = {"testnodes_nodebox.png"},
2323
drawtype = "nodebox",
2424
paramtype = "light",
@@ -30,15 +30,16 @@ minetest.register_node("testnodes:nodebox_overhigh", {
3030
groups = {dig_immediate=3},
3131
})
3232

33-
-- 100% higher than a regular node
33+
-- 95% higher than a regular node
3434
minetest.register_node("testnodes:nodebox_overhigh2", {
35-
description = S("Double-height Nodebox Test Node"),
35+
description = S("+95% high Nodebox Test Node"),
3636
tiles = {"testnodes_nodebox.png"},
3737
drawtype = "nodebox",
3838
paramtype = "light",
3939
node_box = {
4040
type = "fixed",
41-
fixed = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
41+
-- Y max: more is possible, but glitchy
42+
fixed = {-0.5, -0.5, -0.5, 0.5, 1.45, 0.5},
4243
},
4344

4445
groups = {dig_immediate=3},

0 commit comments

Comments
 (0)
Please sign in to comment.