Skip to content

Commit faedde0

Browse files
authoredApr 6, 2020
Some minor Lua API documentation clarifications (#9461)
See #5854
1 parent 528b162 commit faedde0

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed
 

‎doc/lua_api.txt

+19-12
Original file line numberDiff line numberDiff line change
@@ -1010,22 +1010,24 @@ The function of `param2` is determined by `paramtype2` in node definition.
10101010
* Values range 0 - 179. The value stored in `param2` is multiplied by two to
10111011
get the actual rotation in degrees of the node.
10121012
* `paramtype2 = "meshoptions"`
1013-
* Only valid for "plantlike" drawtype. The value of `param2` becomes a
1014-
bitfield which can be used to change how the client draws plantlike nodes.
1015-
* Bits 0, 1 and 2 form a mesh selector.
1016-
Currently the following meshes are choosable:
1013+
* Only valid for "plantlike" drawtype. `param2` encodes the shape and
1014+
optional modifiers of the "plant". `param2` is a bitfield.
1015+
* Bits 0 to 2 select the shape.
1016+
Use only one of the values below:
10171017
* 0 = a "x" shaped plant (ordinary plant)
10181018
* 1 = a "+" shaped plant (just rotated 45 degrees)
10191019
* 2 = a "*" shaped plant with 3 faces instead of 2
10201020
* 3 = a "#" shaped plant with 4 faces instead of 2
10211021
* 4 = a "#" shaped plant with 4 faces that lean outwards
10221022
* 5-7 are unused and reserved for future meshes.
1023-
* Bits 3 through 7 are optional flags that can be combined and give these
1024-
effects:
1025-
* bit 3 (0x08) - Makes the plant slightly vary placement horizontally
1026-
* bit 4 (0x10) - Makes the plant mesh 1.4x larger
1027-
* bit 5 (0x20) - Moves each face randomly a small bit down (1/8 max)
1028-
* bits 6-7 are reserved for future use.
1023+
* Bits 3 to 7 are used to enable any number of optional modifiers.
1024+
Just add the corresponding value(s) below to `param2`:
1025+
* 8 - Makes the plant slightly vary placement horizontally
1026+
* 16 - Makes the plant mesh 1.4x larger
1027+
* 32 - Moves each face randomly a small bit down (1/8 max)
1028+
* values 64 and 128 (bits 6-7) are reserved for future use.
1029+
* Example: `param2 = 0` selects a normal "x" shaped plant
1030+
* Example: `param2 = 17` selects a "+" shaped plant, 1.4x larger (1+16)
10291031
* `paramtype2 = "color"`
10301032
* `param2` tells which color is picked from the palette.
10311033
The palette should have 256 pixels.
@@ -2332,8 +2334,8 @@ Elements
23322334
* `name` fieldname data is transferred to Lua
23332335
* `caption 1`...: name shown on top of tab
23342336
* `current_tab`: index of selected tab 1...
2335-
* `transparent` (optional): show transparent
2336-
* `draw_border` (optional): draw border
2337+
* `transparent` (optional): if true, tabs are semi-transparent
2338+
* `draw_border` (optional): if true, draw a thin line at tab base
23372339

23382340
### `tabheader[<X>,<Y>;<H>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]`
23392341

@@ -7020,6 +7022,7 @@ Used by `minetest.register_node`.
70207022
-- node is deleted from the world or the drops are added. This is
70217023
-- generally the result of either the node being dug or an attached node
70227024
-- becoming detached.
7025+
-- oldmeta is the NodeMetaRef of the oldnode before deletion.
70237026
-- drops is a table of ItemStacks, so any metadata to be preserved can
70247027
-- be added directly to one or more of the dropped items. See
70257028
-- "ItemStackMetaRef".
@@ -7044,10 +7047,14 @@ Used by `minetest.register_node`.
70447047

70457048
on_punch = function(pos, node, puncher, pointed_thing),
70467049
-- default: minetest.node_punch
7050+
-- Called when puncher (an ObjectRef) punches the node at pos.
70477051
-- By default calls minetest.register_on_punchnode callbacks.
70487052

70497053
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing),
70507054
-- default: nil
7055+
-- Called when clicker (an ObjectRef) "rightclicks"
7056+
-- ("rightclick" here stands for the placement key) while pointing at
7057+
-- the node at pos with 'node' being the node table.
70517058
-- itemstack will hold clicker's wielded item.
70527059
-- Shall return the leftover itemstack.
70537060
-- Note: pointed_thing can be nil, if a mod calls this function.

0 commit comments

Comments
 (0)
Please sign in to comment.