diff --git a/lua_api.html b/lua_api.html index 3f9c108..8f3b120 100644 --- a/lua_api.html +++ b/lua_api.html @@ -329,6 +329,7 @@ layout: default
If you have any difficulty in understanding this, please read Programming in Lua.
np_puff_top
and np_puff_bottom
, respectivel
instances of 3d perlin noise with diffferent seeds, both described by
noise_params
. random_factor
varies the influence random chance has on
placement of an ore inside the vein, which is 1
by default. Note that
-modifying this parameter may require adjusting noise_threshhold
.
+modifying this parameter may require adjusting noise_threshold
.
The parameters clust_scarcity
, clust_num_ores
, and clust_size
are ignored
by this ore type. This ore type is difficult to control since it is sensitive
to small changes. The following is a decent set of parameters to work from:
@@ -1011,7 +1012,7 @@ to small changes. The following is a decent set of parameters to work from:
persist = 0.5,
flags = "eased",
},
-noise_threshhold = 1.6
+noise_threshold = 1.6
WARNING: Use this ore type very sparingly since it is ~200x more computationally expensive than any other ore.
@@ -1463,12 +1464,16 @@ the entity itself.The instance of a node in the world normally only contains the three values
mentioned in "Nodes". However, it is possible to insert extra data into a
node. It is called "node metadata"; See "NodeMetaRef
".
Metadata contains two things: - A key-value store - An inventory
-Some of the values in the key-value store are handled specially:
- formspec
: Defines a right-click inventory menu. See "Formspec".
- infotext
: Text shown on the screen when the node is pointed at
Metadata contains two things:
+Some of the values in the key-value store are handled specially:
+formspec
: Defines a right-click inventory menu. See "Formspec".infotext
: Text shown on the screen when the node is pointed atExample stuff:
local meta = minetest.get_meta(pos) meta:set_string("formspec", @@ -2237,7 +2242,11 @@ or string form, a ColorString (defined above):
# minetest.get_password_hash(name, raw_password)
-
- Convert a name-password pair to a password hash that Minetest can use
+- Convert a name-password pair to a password hash that Minetest can use.
+- The returned value alone is not a good basis for password checks based
+- on comparing the password hash in the database with the password hash
+- from the function, with an externally provided password, as the hash
+- in the db might use the new SRP verifier format.
# @@ -2537,7 +2546,7 @@ andminetest.string_to_privs(str)
: returns{priv1=true,...}
minetest.auth_reload
call the authetification handler.# playername
: name of player to show formspec# -formname
: name passed toon_player_receive_fields
callbacks. It should follow the"modname:<whatever>"
naming convention# +formspec
: formspec to display# formspec
: formspec to display# minetest.formspec_escape(string)
: returns a string@@ -3572,20 +3581,22 @@ core.CONTENT_IGNORE (ID for "ignore" nodes)
Mapgen VoxelManip objects
Inside of
+on_generated()
callbacks, it is possible to retrieve the same VoxelManip object used by the core's Map Generator (commonly abbreviated Mapgen). Most of the rules previously described still apply -but with a few differences: - The Mapgen VoxelManip object is retrieved using:minetest.get_mapgen_object("voxelmanip")
- This VoxelManip object already has the region of map just generated loaded into it; it's not necessary - to callVoxelManip:read_from_map()
before using a Mapgen VoxelManip. - Theon_generated()
callbacks of some mods may place individual nodes in the generated area using +but with a few differences:
minetest.get_mapgen_object("voxelmanip")
VoxelManip:read_from_map()
before using a Mapgen VoxelManip.on_generated()
callbacks of some mods may place individual nodes in the generated area using
non-VoxelManip map modification methods. Because the same Mapgen VoxelManip object is passed through
each on_generated()
callback, it becomes necessary for the Mapgen VoxelManip object to maintain
consistency with the current map state. For this reason, calling any of the following functions:
minetest.add_node()
, minetest.set_node()
, or minetest.swap_node()
- will also update the Mapgen VoxelManip object's internal state active on the current thread.
- After modifying the Mapgen VoxelManip object's internal buffer, it may be necessary to update lighting
- information using either: VoxelManip:calc_lighting()
or VoxelManip:set_lighting()
.
-* VoxelManip:update_map()
does not need to be called after write_to_map()
. The map update is performed
- automatically after all on_generated callbacks have been run for that generated block.
+ will also update the Mapgen VoxelManip object's internal state active on the current thread.VoxelManip:calc_lighting()
or VoxelManip:set_lighting()
.VoxelManip:update_map()
does not need to be called after write_to_map()
. The map update is performed
+ automatically after all on_generated callbacks have been run for that generated block.If any VoxelManip contents were set to a liquid node, VoxelManip:update_liquids()
must be called
for these liquid nodes to begin flowing. It is recommended to call this function only after having
@@ -3607,7 +3618,7 @@ will place the schematic inside of the VoxelManip.
on_generated()
callback, consider passing
+on_generated()
callback, consider passing
a file-scoped table as the optional parameter to VoxelManip:get_data()
, which serves as a static
buffer the function can use to write map data to instead of returning a new table each call. This
greatly enhances performance by avoiding unnecessary memory allocations.VoxelManip
that was retrieved from minetest.get_mapgen_object
-set_lighting(light, p1, p2)
: Set the lighting within the VoxelManip
to a uniform valueset_lighting(light, [p1, p2])
: Set the lighting within the VoxelManip
to a uniform valuelight
is a table, {day=<0...15>, night=<0...15>}
VoxelManip
object from minetest.get_mapgen_object
p1
, p2
) is the area in which lighting is set;
@@ -3657,10 +3668,12 @@ will place the schematic inside of the VoxelManip.
get_param2_data()
: Gets the raw param2
data read into the VoxelManip
objectset_param2_data(param2_data)
: Sets the param2
contents of each node in the VoxelManip
calc_lighting(p1, p2)
: Calculate lighting within the VoxelManip
update_liquids()
: Update liquid flowregister_biome
){
+ name = "tundra",
+ node_dust = "default:snow",
+-- ^ Node dropped onto upper surface after all else is generated.
+ node_top = "default:dirt_with_snow",
+ depth_top = 1,
+-- ^ Node forming surface layer of biome and thickness of this layer.
+ node_filler = "default:permafrost",
+ depth_filler = 3,
+-- ^ Node forming lower layer of biome and thickness of this layer.
+ node_stone = "default:bluestone",
+-- ^ Node that replaces all stone nodes between roughly y_min and y_max.
+ node_water_top = "default:ice",
+ depth_water_top = 10,
+-- ^ Node forming a surface layer in seawater with the defined thickness.
+ node_water = "",
+-- ^ Node that replaces all seawater nodes not in the defined surface layer.
+ node_river_water = "default:ice",
+-- ^ Node that replaces river water in mapgens that use default:river_water.
+ y_min = 1,
+ y_max = 31000,
+-- ^ Lower and upper limits for biome.
+-- ^ Because biome is not recalculated for every node in a node column
+-- ^ some biome materials can exceed their limits, especially stone.
+-- ^ For each node column in a mapchunk, biome is only recalculated at column
+-- ^ top and at each of these surfaces:
+-- ^ Ground below air, water below air, ground below water.
+-- ^ The selected biome then stays in effect for all nodes below until
+-- ^ column base or the next biome recalculation.
+ heat_point = 0,
+ humidity_point = 50,
+-- ^ Characteristic average temperature and humidity for the biome.
+-- ^ These values create 'biome points' on a voronoi diagram that has heat
+-- ^ and humidity as axes. The resulting voronoi cells determine which
+-- ^ heat/humidity points belong to which biome, and therefore determine
+-- ^ the area and location of each biome in the world.
+-- ^ The biome points need to be carefully and evenly spaced on the voronoi
+-- ^ diagram to result in roughly equal size biomes.
+-- ^ Heat and humidity have average values of 50, vary mostly between
+-- ^ 0 and 100 but also often exceed these values.
+-- ^ Heat is not in degrees celcius, both values are abstract.
+}
+
register_decoration
){
deco_type = "simple", -- See "Decoration types"