Skip to content

Commit 8059ca0

Browse files
committed
Update lua_api.html
1 parent ec90cf9 commit 8059ca0

File tree

1 file changed

+53
-20
lines changed

1 file changed

+53
-20
lines changed

lua_api.html

+53-20
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@ <h2 id="table-of-contents">Table of Contents</h2>
7979
<li><a href="#ore-types">Ore types</a><ul>
8080
<li><a href="#scatter">scatter</a></li>
8181
<li><a href="#sheet">sheet</a></li>
82+
<li><a href="#puff">puff</a></li>
8283
<li><a href="#blob">blob</a></li>
83-
<li><a href="#vein">`vein</a></li>
84+
<li><a href="#vein">vein</a></li>
8485
</ul>
8586
</li>
8687
<li><a href="#ore-attributes">Ore attributes</a><ul>
8788
<li><a href="#absheight">absheight</a></li>
89+
<li><a href="#puff_cliffs">puff_cliffs</a></li>
90+
<li><a href="#puff_additive_composition">puff_additive_composition</a></li>
8891
</ul>
8992
</li>
9093
<li><a href="#decoration-types">Decoration types</a><ul>
@@ -228,7 +231,7 @@ <h2 id="table-of-contents">Table of Contents</h2>
228231
<li><a href="#methods">Methods</a></li>
229232
</ul>
230233
</li>
231-
<li><a href="#notetimerref">NoteTimerRef</a><ul>
234+
<li><a href="#nodetimerref">NodeTimerRef</a><ul>
232235
<li><a href="#methods_1">Methods</a></li>
233236
</ul>
234237
</li>
@@ -336,7 +339,7 @@ <h2 id="introduction">Introduction</h2>
336339
<ul>
337340
<li>More information at <a href="http://www.minetest.net/">http://www.minetest.net/</a></li>
338341
<li>Developer Wiki: <a href="http://dev.minetest.net/">http://dev.minetest.net/</a></li>
339-
</ul>This page was last updated 03/September/2015.<br />See <a href="https://github.com/minetest/minetest/blob/master/doc/lua_api.txt">doc/lua_api.txt</a> for the latest version (in plaintext).<br />Generated using <a href="https://github.com/rubenwardy/minetest_modding_book/blob/gh-pages/update_lua_api.py">a Python script</a>.<h2 id="programming-in-lua">Programming in Lua</h2>
342+
</ul>This page was last updated 25/September/2015.<br />See <a href="https://github.com/minetest/minetest/blob/master/doc/lua_api.txt">doc/lua_api.txt</a> for the latest version (in plaintext).<br />Generated using <a href="https://github.com/rubenwardy/minetest_modding_book/blob/gh-pages/update_lua_api.py">a Python script</a>.<h2 id="programming-in-lua">Programming in Lua</h2>
340343
<p>If you have any difficulty in understanding this, please read
341344
<a href="http://www.lua.org/pil/">Programming in Lua</a>.</p>
342345
<h2 id="startup">Startup</h2>
@@ -942,20 +945,31 @@ <h3 id="scatter"><code>scatter</code></h3>
942945
a non-equal distribution of ore.</p>
943946
<h3 id="sheet"><code>sheet</code></h3>
944947
<p>Creates a sheet of ore in a blob shape according to the 2D perlin noise
945-
described by <code>noise_params</code>. The relative height of the sheet can be
946-
controlled by the same perlin noise as well, by specifying a non-zero
947-
<code>scale</code> parameter in <code>noise_params</code>.</p>
948-
<p><strong>IMPORTANT</strong>: The noise is not transformed by <code>offset</code> or <code>scale</code> when comparing
949-
against the noise threshold, but scale is used to determine relative height.
950-
The height of the blob is randomly scattered, with a maximum height of <code>clust_size</code>.</p>
951-
<p><code>clust_scarcity</code> and <code>clust_num_ores</code> are ignored.</p>
952-
<p>This is essentially an improved version of the so-called "stratus" ore seen in
953-
some unofficial mods.</p>
948+
described by <code>noise_params</code> and <code>noise_threshold</code>. This is essentially an
949+
improved version of the so-called "stratus" ore seen in some unofficial mods.</p>
950+
<p>This sheet consists of vertical columns of uniform randomly distributed height,
951+
varying between the inclusive range <code>column_height_min</code> and <code>column_height_max</code>.
952+
If <code>column_height_min</code> is not specified, this parameter defaults to 1.
953+
If <code>column_height_max</code> is not specified, this parameter defaults to <code>clust_size</code>
954+
for reverse compatibility. New code should prefer <code>column_height_max</code>.</p>
955+
<p>The <code>column_midpoint_factor</code> parameter controls the position of the column at which
956+
ore eminates from. If 1, columns grow upward. If 0, columns grow downward. If 0.5,
957+
columns grow equally starting from each direction. <code>column_midpoint_factor</code> is a
958+
decimal number ranging in value from 0 to 1. If this parameter is not specified,
959+
the default is 0.5.</p>
960+
<p>The ore parameters <code>clust_scarcity</code> and <code>clust_num_ores</code> are ignored for this ore type.</p>
961+
<h3 id="puff"><code>puff</code></h3>
962+
<p>Creates a sheet of ore in a cloud-like puff shape.</p>
963+
<p>As with the <code>sheet</code> ore type, the size and shape of puffs are described by
964+
<code>noise_params</code> and <code>noise_threshold</code> and are placed at random vertical positions
965+
within the currently generated chunk.</p>
966+
<p>The vertical top and bottom displacement of each puff are determined by the noise
967+
parameters <code>np_puff_top</code> and <code>np_puff_bottom</code>, respectively.</p>
954968
<h3 id="blob"><code>blob</code></h3>
955969
<p>Creates a deformed sphere of ore according to 3d perlin noise described by
956970
<code>noise_params</code>. The maximum size of the blob is <code>clust_size</code>, and
957971
<code>clust_scarcity</code> has the same meaning as with the <code>scatter</code> type.</p>
958-
<h3 id="vein">`vein</h3>
972+
<h3 id="vein"><code>vein</code></h3>
959973
<p>Creates veins of ore varying in density by according to the intersection of two
960974
instances of 3d perlin noise with diffferent seeds, both described by
961975
<code>noise_params</code>. <code>random_factor</code> varies the influence random chance has on
@@ -983,6 +997,15 @@ <h2 id="ore-attributes">Ore attributes</h2>
983997
<h3 id="absheight"><code>absheight</code></h3>
984998
<p>Also produce this same ore between the height range of <code>-y_max</code> and <code>-y_min</code>.</p>
985999
<p>Useful for having ore in sky realms without having to duplicate ore entries.</p>
1000+
<h3 id="puff_cliffs"><code>puff_cliffs</code></h3>
1001+
<p>If set, puff ore generation will not taper down large differences in displacement
1002+
when approaching the edge of a puff. This flag has no effect for ore types other
1003+
than <code>puff</code>.</p>
1004+
<h3 id="puff_additive_composition"><code>puff_additive_composition</code></h3>
1005+
<p>By default, when noise described by <code>np_puff_top</code> or <code>np_puff_bottom</code> results in a
1006+
negative displacement, the sub-column at that point is not generated. With this
1007+
attribute set, puff ore generation will instead generate the absolute difference in
1008+
noise displacement values. This flag has no effect for ore types other than <code>puff</code>.</p>
9861009
<h2 id="decoration-types">Decoration types</h2>
9871010
<p>The varying types of decorations that can be placed.</p>
9881011
<p>The default value is <code>simple</code>, and is currently the only type supported.</p>
@@ -1900,6 +1923,10 @@ <h2 id="helper-functions">Helper functions</h2>
19001923
<li>Same but in reverse. Returns <code>nil</code> if the string can't be parsed to a position.</li>
19011924
</ul>
19021925
</li>
1926+
<li><code>minetest.string_to_area("(X1, Y1, Z1) (X2, Y2, Z2)")</code>: returns two positions<ul>
1927+
<li>Converts a string representing an area box into two positions</li>
1928+
</ul>
1929+
</li>
19031930
<li><code>minetest.formspec_escape(string)</code>: returns a string<ul>
19041931
<li>escapes the characters "[", "]", "\", "," and ";", which can not be used in formspecs</li>
19051932
</ul>
@@ -2235,15 +2262,16 @@ <h3 id="environment-access">Environment access</h3>
22352262
<li>Returns <code>nil</code> for unloaded area</li>
22362263
</ul>
22372264
</li>
2238-
<li>
2239-
<p><code>minetest.get_node_light(pos, timeofday)</code> returns a number between <code>0</code> and <code>15</code> or <code>nil</code></p>
2240-
<ul>
2265+
<li><code>minetest.get_node_light(pos, timeofday)</code><ul>
2266+
<li>Gets the light value at the given position. Note that the light value
2267+
"inside" the node at the given position is returned, so you usually want
2268+
to get the light value of a neighbor.</li>
2269+
<li><code>pos</code>: The position where to measure the light.</li>
22412270
<li><code>timeofday</code>: <code>nil</code> for current time, <code>0</code> for night, <code>0.5</code> for day</li>
2271+
<li>Returns a number between <code>0</code> and <code>15</code> or <code>nil</code></li>
22422272
</ul>
22432273
</li>
2244-
<li>
2245-
<p><code>minetest.place_node(pos, node)</code></p>
2246-
<ul>
2274+
<li><code>minetest.place_node(pos, node)</code><ul>
22472275
<li>Place node with the same effects that a player would cause</li>
22482276
</ul>
22492277
</li>
@@ -2365,6 +2393,11 @@ <h3 id="environment-access">Environment access</h3>
23652393
<li>clear all objects in the environments</li>
23662394
</ul>
23672395
</li>
2396+
<li><code>minetest.emerge_area(pos1, pos2)</code><ul>
2397+
<li>queues all mapblocks in the area from pos1 to pos2, inclusive, for emerge</li>
2398+
<li>i.e. asynchronously loads blocks from disk, or if inexistent, generates them</li>
2399+
</ul>
2400+
</li>
23682401
<li><code>minetest.delete_area(pos1, pos2)</code><ul>
23692402
<li>delete all mapblocks in the area from pos1 to pos2, inclusive</li>
23702403
</ul>
@@ -2972,7 +3005,7 @@ <h4 id="methods">Methods</h4>
29723005
</ul>
29733006
</li>
29743007
</ul>
2975-
<h3 id="notetimerref"><code>NoteTimerRef</code></h3>
3008+
<h3 id="nodetimerref"><code>NodeTimerRef</code></h3>
29763009
<p>Node Timers: a high resolution persistent per-node timer.
29773010
Can be gotten via <code>minetest.get_node_timer(pos)</code>.</p>
29783011
<h4 id="methods_1">Methods</h4>

0 commit comments

Comments
 (0)