Skip to content

Commit b592c52

Browse files
committed
Lua_api.txt: Split long lines part 1
1 parent 1137f46 commit b592c52

File tree

1 file changed

+94
-69
lines changed

1 file changed

+94
-69
lines changed

doc/lua_api.txt

+94-69
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ Parameters:
368368
* `<p>` = current animation frame
369369

370370
Draw a step of the crack animation on the texture.
371-
`crack` draws it normally, while `cracko` lays it over, keeping transparent pixels intact.
371+
`crack` draws it normally, while `cracko` lays it over, keeping transparent
372+
pixels intact.
372373

373374
Example:
374375

@@ -457,7 +458,8 @@ Example:
457458
default_stone.png^[transformFXR90
458459

459460
#### `[inventorycube{<top>{<left>{<right>`
460-
Escaping does not apply here and `^` is replaced by `&` in texture names instead.
461+
Escaping does not apply here and `^` is replaced by `&` in texture names
462+
instead.
461463

462464
Create an inventory cube texture using the side textures.
463465

@@ -510,8 +512,8 @@ texture pixel.
510512
Multiplies texture colors with the given color.
511513
`<color>` is specified as a `ColorString`.
512514
Result is more like what you'd expect if you put a color on top of another
513-
color. Meaning white surfaces get a lot of your new color while black parts don't
514-
change very much.
515+
color. Meaning white surfaces get a lot of your new color while black parts
516+
don't change very much.
515517

516518
Hardware coloring
517519
-----------------
@@ -808,16 +810,19 @@ the global `minetest.registered_*` tables.
808810

809811
* `minetest.register_decoration(decoration definition)`
810812
* returns an integer uniquely identifying the registered decoration
811-
* added to `minetest.registered_decorations` with the key of `decoration.name`
813+
* added to `minetest.registered_decorations` with the key of
814+
`decoration.name`.
812815
* if `decoration.name` is nil, the key is the returned ID
813816

814817
* `minetest.register_schematic(schematic definition)`
815818
* returns an integer uniquely identifying the registered schematic
816819
* added to `minetest.registered_schematic` with the key of `schematic.name`
817820
* if `schematic.name` is nil, the key is the returned ID
818-
* if the schematic is loaded from a file, schematic.name is set to the filename
819-
* if the function is called when loading the mod, and schematic.name is a relative
820-
path, then the current mod path will be prepended to the schematic filename
821+
* if the schematic is loaded from a file, schematic.name is set to the
822+
filename.
823+
* if the function is called when loading the mod, and schematic.name is a
824+
relative path, then the current mod path will be prepended to the
825+
schematic filename.
821826

822827
* `minetest.clear_registered_biomes()`
823828
* clears all biomes currently registered
@@ -909,20 +914,22 @@ node definition:
909914
^ Only valid for "nodebox" with 'type = "leveled"', and "plantlike_rooted".
910915
Leveled nodebox:
911916
The level of the top face of the nodebox is stored in param2.
912-
The other faces are defined by 'fixed = {}' like 'type = "fixed"' nodeboxes.
917+
The other faces are defined by 'fixed = {}' like 'type = "fixed"'
918+
nodeboxes.
913919
The nodebox height is (param2 / 64) nodes.
914920
The maximum accepted value of param2 is 127.
915921
Rooted plantlike:
916922
The height of the 'plantlike' section is stored in param2.
917923
The height is (param2 / 16) nodes.
918924
paramtype2 == "degrotate"
919-
^ The rotation of this node is stored in param2. Plants are rotated this way.
925+
^ Only valid for "plantlike". The rotation of the node is stored in param2.
920926
Values range 0 - 179. The value stored in param2 is multiplied by two to
921-
get the actual rotation of the node.
927+
get the actual rotation in degrees of the node.
922928
paramtype2 == "meshoptions"
923-
^ Only valid for "plantlike". The value of param2 becomes a bitfield which can
924-
be used to change how the client draws plantlike nodes. Bits 0, 1 and 2 form
925-
a mesh selector. Currently the following meshes are choosable:
929+
^ Only valid for "plantlike". The value of param2 becomes a bitfield which
930+
can be used to change how the client draws plantlike nodes.
931+
Bits 0, 1 and 2 form a mesh selector.
932+
Currently the following meshes are choosable:
926933
0 = a "x" shaped plant (ordinary plant)
927934
1 = a "+" shaped plant (just rotated 45 degrees)
928935
2 = a "*" shaped plant with 3 faces instead of 2
@@ -949,7 +956,8 @@ node definition:
949956
is picked from the palette.
950957
The palette should have 32 pixels.
951958
paramtype2 == "glasslikeliquidlevel"
952-
^ Only valid for "glasslike_framed" or "glasslike_framed_optional" drawtypes.
959+
^ Only valid for "glasslike_framed" or "glasslike_framed_optional"
960+
drawtypes.
953961
param2 values 0-63 define 64 levels of internal liquid, 0 being empty and
954962
63 being full.
955963
Liquid texture is defined using `special_tiles = {"modname_tilename.png"},`
@@ -981,7 +989,8 @@ Look for examples in `games/minimal` or `games/minetest_game`.
981989
* `mesh` -- Use models for nodes, see below
982990
* `plantlike_rooted` -- See below
983991

984-
`*_optional` drawtypes need less rendering time if deactivated (always client side).
992+
`*_optional` drawtypes need less rendering time if deactivated
993+
(always client side).
985994

986995
Node boxes
987996
----------
@@ -1002,9 +1011,9 @@ A nodebox is defined as any of:
10021011
fixed = box OR {box1, box2, ...}
10031012
}
10041013
{
1005-
-- A variable height box (or boxes) with the top face position defined by
1006-
-- the node parameter 'leveled = ', or if 'paramtype2 == "leveled"' by
1007-
-- param2.
1014+
-- A variable height box (or boxes) with the top face position defined
1015+
-- by the node parameter 'leveled = ', or if 'paramtype2 == "leveled"'
1016+
-- by param2.
10081017
-- Other faces are defined by 'fixed = {}' as with 'type = "fixed"'.
10091018
type = "leveled",
10101019
fixed = box OR {box1, box2, ...}
@@ -1038,7 +1047,8 @@ A nodebox is defined as any of:
10381047
disconnected_back = box OR {box1, box2, ...}
10391048
disconnected_right = box OR {box1, box2, ...}
10401049
disconnected = box OR {box1, box2, ...} -- when there is *no* neighbour
1041-
disconnected_sides = box OR {box1, box2, ...} -- when there are *no* neighbours to the sides
1050+
disconnected_sides = box OR {box1, box2, ...} -- when there are *no*
1051+
neighbours to the sides
10421052
}
10431053

10441054
A `box` is defined as:
@@ -1080,14 +1090,16 @@ Offset that the noise is translated by (i.e. added) after calculation.
10801090
Factor that the noise is scaled by (i.e. multiplied) after calculation.
10811091

10821092
### `spread`
1083-
Vector containing values by which each coordinate is divided by before calculation.
1093+
Vector containing values by which each coordinate is divided by before
1094+
calculation.
10841095
Higher spread values result in larger noise features.
10851096

10861097
A value of `{x=250, y=250, z=250}` is common.
10871098

10881099
### `seed`
1089-
Random seed for the noise. Add the world seed to a seed offset for world-unique noise.
1090-
In the case of `minetest.get_perlin()`, this value has the world seed automatically added.
1100+
Random seed for the noise. Add the world seed to a seed offset for world-unique
1101+
noise. In the case of `minetest.get_perlin()`, this value has the world seed
1102+
automatically added.
10911103

10921104
### `octaves`
10931105
Number of times the noise gradient is accumulated into the noise.
@@ -1097,10 +1109,11 @@ Increase this number to increase the amount of detail in the resulting noise.
10971109
A value of `6` is common.
10981110

10991111
### `persistence`
1100-
Factor by which the effect of the noise gradient function changes with each successive octave.
1112+
Factor by which the effect of the noise gradient function changes with each
1113+
successive octave.
11011114

1102-
Values less than `1` make the details of successive octaves' noise diminish, while values
1103-
greater than `1` make successive octaves stronger.
1115+
Values less than `1` make the details of successive octaves' noise diminish,
1116+
while values greater than `1` make successive octaves stronger.
11041117

11051118
A value of `0.6` is common.
11061119

@@ -1115,13 +1128,15 @@ Leave this field unset for no special handling.
11151128
Currently supported are `defaults`, `eased` and `absvalue`.
11161129

11171130
#### `defaults`
1118-
Specify this if you would like to keep auto-selection of eased/not-eased while specifying
1119-
some other flags.
1131+
Specify this if you would like to keep auto-selection of eased/not-eased while
1132+
specifying some other flags.
11201133

11211134
#### `eased`
1122-
Maps noise gradient values onto a quintic S-curve before performing interpolation.
1123-
This results in smooth, rolling noise. Disable this (`noeased`) for sharp-looking noise.
1124-
If no flags are specified (or defaults is), 2D noise is eased and 3D noise is not eased.
1135+
Maps noise gradient values onto a quintic S-curve before performing
1136+
interpolation. This results in smooth, rolling noise.
1137+
Disable this (`noeased`) for sharp-looking noise.
1138+
If no flags are specified (or defaults is), 2D noise is eased and 3D noise is
1139+
not eased.
11251140

11261141
#### `absvalue`
11271142
Accumulates the absolute value of each noise gradient result.
@@ -1151,9 +1166,9 @@ All default ores are of the uniformly-distributed scatter type.
11511166
### `scatter`
11521167
Randomly chooses a location and generates a cluster of ore.
11531168

1154-
If `noise_params` is specified, the ore will be placed if the 3D perlin noise at
1155-
that point is greater than the `noise_threshold`, giving the ability to create
1156-
a non-equal distribution of ore.
1169+
If `noise_params` is specified, the ore will be placed if the 3D perlin noise
1170+
at that point is greater than the `noise_threshold`, giving the ability to
1171+
create a non-equal distribution of ore.
11571172

11581173
### `sheet`
11591174
Creates a sheet of ore in a blob shape according to the 2D perlin noise
@@ -1164,29 +1179,31 @@ This sheet consists of vertical columns of uniform randomly distributed height,
11641179
varying between the inclusive range `column_height_min` and `column_height_max`.
11651180
If `column_height_min` is not specified, this parameter defaults to 1.
11661181
If `column_height_max` is not specified, this parameter defaults to `clust_size`
1167-
for reverse compatibility. New code should prefer `column_height_max`.
1182+
for reverse compatibility. New code should prefer `column_height_max`.
11681183

1169-
The `column_midpoint_factor` parameter controls the position of the column at which
1170-
ore emanates from. If 1, columns grow upward. If 0, columns grow downward. If 0.5,
1171-
columns grow equally starting from each direction. `column_midpoint_factor` is a
1172-
decimal number ranging in value from 0 to 1. If this parameter is not specified,
1173-
the default is 0.5.
1184+
The `column_midpoint_factor` parameter controls the position of the column at
1185+
which ore emanates from.
1186+
If 1, columns grow upward. If 0, columns grow downward. If 0.5, columns grow
1187+
equally starting from each direction.
1188+
`column_midpoint_factor` is a decimal number ranging in value from 0 to 1. If
1189+
this parameter is not specified, the default is 0.5.
11741190

1175-
The ore parameters `clust_scarcity` and `clust_num_ores` are ignored for this ore type.
1191+
The ore parameters `clust_scarcity` and `clust_num_ores` are ignored for this
1192+
ore type.
11761193

11771194
### `puff`
11781195
Creates a sheet of ore in a cloud-like puff shape.
11791196

11801197
As with the `sheet` ore type, the size and shape of puffs are described by
1181-
`noise_params` and `noise_threshold` and are placed at random vertical positions
1182-
within the currently generated chunk.
1198+
`noise_params` and `noise_threshold` and are placed at random vertical
1199+
positions within the currently generated chunk.
11831200

1184-
The vertical top and bottom displacement of each puff are determined by the noise
1185-
parameters `np_puff_top` and `np_puff_bottom`, respectively.
1201+
The vertical top and bottom displacement of each puff are determined by the
1202+
noise parameters `np_puff_top` and `np_puff_bottom`, respectively.
11861203

11871204
### `blob`
11881205
Creates a deformed sphere of ore according to 3d perlin noise described by
1189-
`noise_params`. The maximum size of the blob is `clust_size`, and
1206+
`noise_params`. The maximum size of the blob is `clust_size`, and
11901207
`clust_scarcity` has the same meaning as with the `scatter` type.
11911208

11921209
### `vein`
@@ -1195,8 +1212,8 @@ instances of 3d perlin noise with different seeds, both described by
11951212
`noise_params`.
11961213

11971214
`random_factor` varies the influence random chance has on placement of an ore
1198-
inside the vein, which is `1` by default. Note that modifying this parameter may
1199-
require adjusting `noise_threshold`.
1215+
inside the vein, which is `1` by default. Note that modifying this parameter
1216+
may require adjusting `noise_threshold`.
12001217

12011218
The parameters `clust_scarcity`, `clust_num_ores`, and `clust_size` are ignored
12021219
by this ore type.
@@ -1222,8 +1239,8 @@ computationally expensive than any other ore.
12221239
Creates a single undulating ore stratum that is continuous across mapchunk
12231240
borders and horizontally spans the world.
12241241

1225-
The 2D perlin noise described by `noise_params` defines the Y co-ordinate of the
1226-
stratum midpoint. The 2D perlin noise described by `np_stratum_thickness`
1242+
The 2D perlin noise described by `noise_params` defines the Y co-ordinate of
1243+
the stratum midpoint. The 2D perlin noise described by `np_stratum_thickness`
12271244
defines the stratum's vertical thickness (in units of nodes). Due to being
12281245
continuous across mapchunk borders the stratum's vertical thickness is
12291246
unlimited.
@@ -1234,8 +1251,8 @@ to y_max in a simple horizontal stratum.
12341251
A parameter `stratum_thickness` can be provided instead of the noise parameter
12351252
`np_stratum_thickness`, to create a constant thickness.
12361253

1237-
Leaving out one or both noise parameters makes the ore generation less intensive,
1238-
useful when adding multiple strata.
1254+
Leaving out one or both noise parameters makes the ore generation less
1255+
intensive, useful when adding multiple strata.
12391256

12401257
`y_min` and `y_max` define the limits of the ore generation and for performance
12411258
reasons should be set as close together as possible but without clipping the
@@ -1255,15 +1272,16 @@ Currently supported flags:
12551272
`puff_cliffs`, `puff_additive_composition`.
12561273

12571274
### `puff_cliffs`
1258-
If set, puff ore generation will not taper down large differences in displacement
1259-
when approaching the edge of a puff. This flag has no effect for ore types other
1260-
than `puff`.
1275+
If set, puff ore generation will not taper down large differences in
1276+
displacement when approaching the edge of a puff. This flag has no effect for
1277+
ore types other than `puff`.
12611278

12621279
### `puff_additive_composition`
1263-
By default, when noise described by `np_puff_top` or `np_puff_bottom` results in a
1264-
negative displacement, the sub-column at that point is not generated. With this
1265-
attribute set, puff ore generation will instead generate the absolute difference in
1266-
noise displacement values. This flag has no effect for ore types other than `puff`.
1280+
By default, when noise described by `np_puff_top` or `np_puff_bottom` results
1281+
in a negative displacement, the sub-column at that point is not generated. With
1282+
this attribute set, puff ore generation will instead generate the absolute
1283+
difference in noise displacement values. This flag has no effect for ore types
1284+
other than `puff`.
12671285

12681286
Decoration types
12691287
----------------
@@ -1290,22 +1308,28 @@ A schematic specifier identifies a schematic by either a filename to a
12901308
Minetest Schematic file (`.mts`) or through raw data supplied through Lua,
12911309
in the form of a table. This table specifies the following fields:
12921310

1293-
* The `size` field is a 3D vector containing the dimensions of the provided schematic. (required)
1294-
* The `yslice_prob` field is a table of {ypos, prob} which sets the `ypos`th vertical slice
1295-
of the schematic to have a `prob / 256 * 100` chance of occurring. (default: 255)
1311+
* The `size` field is a 3D vector containing the dimensions of the provided
1312+
schematic. (required)
1313+
* The `yslice_prob` field is a table of {ypos, prob} which sets the `ypos`th
1314+
vertical slice of the schematic to have a `prob / 256 * 100` chance of
1315+
occurring. (default: 255)
12961316
* The `data` field is a flat table of MapNode tables making up the schematic,
12971317
in the order of `[z [y [x]]]`. (required)
12981318
Each MapNode table contains:
12991319
* `name`: the name of the map node to place (required)
1300-
* `prob` (alias `param1`): the probability of this node being placed (default: 255)
1301-
* `param2`: the raw param2 value of the node being placed onto the map (default: 0)
1302-
* `force_place`: boolean representing if the node should forcibly overwrite any
1303-
previous contents (default: false)
1320+
* `prob` (alias `param1`): the probability of this node being placed
1321+
(default: 255)
1322+
* `param2`: the raw param2 value of the node being placed onto the map
1323+
(default: 0)
1324+
* `force_place`: boolean representing if the node should forcibly overwrite
1325+
any previous contents (default: false)
13041326

13051327
About probability values:
13061328

1307-
* A probability value of `0` or `1` means that node will never appear (0% chance).
1308-
* A probability value of `254` or `255` means the node will always appear (100% chance).
1329+
* A probability value of `0` or `1` means that node will never appear
1330+
(0% chance).
1331+
* A probability value of `254` or `255` means the node will always appear
1332+
(100% chance).
13091333
* If the probability value `p` is greater than `1`, then there is a
13101334
`(p / 256 * 100)` percent chance that node will appear when the schematic is
13111335
placed on the map.
@@ -1321,7 +1345,8 @@ Currently supported flags: `place_center_x`, `place_center_y`, `place_center_z`,
13211345
* `place_center_x`: Placement of this decoration is centered along the X axis.
13221346
* `place_center_y`: Placement of this decoration is centered along the Y axis.
13231347
* `place_center_z`: Placement of this decoration is centered along the Z axis.
1324-
* `force_placement`: Schematic nodes other than "ignore" will replace existing nodes.
1348+
* `force_placement`: Schematic nodes other than "ignore" will replace existing
1349+
nodes.
13251350

13261351

13271352
HUD element types

0 commit comments

Comments
 (0)