From bd0f2705fc5d20bd5b057c797a184e826c196f1c Mon Sep 17 00:00:00 2001
From: rubenwardy Content and functionality can be added to Minetest 0.4 by using Lua
-scripting in run-time loaded mods. Content and functionality can be added to Minetest using Lua scripting
+in run-time loaded mods. A mod is a self-contained bunch of scripts, textures and other related
-things that is loaded by and interfaces with Minetest.This is lua_api.txt nicely formated: I did not write this
-This page was last updated 28/November/2017.
See doc/lua_api.txt for the latest version (in plaintext).
Generated using a Python script.
See doc/lua_api.txt for the latest version (in plaintext).
Generated using a Python script.
Table of Contents
@@ -411,24 +411,25 @@ This page was last updated 28/November/2017.
See ParticleSpawner definition (add_particlespawner)
Introduction
-
Mods are contained and ran solely on the server side. Definitions and media files are automatically transferred to the client.
If you see a deficiency in the API, feel free to attempt to add the -functionality in the engine and API.
+functionality in the engine and API, and to document it here.If you have any difficulty in understanding this, please read Programming in Lua.
init.lua
scripts in a shared environment.
$path_user/games/gameid/
where gameid
is unique to each game.
The game directory contains the file game.conf
, which contains these fields:
The game directory contains the file game.conf
, which contains:
name = <Human-readable full name of the game>
e.g.
name = Minetest
+Optionally, game.conf can also contain:
+disallowed_mapgens = <comma-separated mapgens>
+
+e.g.
+disallowed_mapgens = v5,v6,flat
+
+These mapgens are removed from the list of mapgens for the game.
The game directory can contain the file minetest.conf, which will be used
to set default settings when running the particular game.
It can also contain a settingtypes.txt in the same format as the one in builtin.
@@ -549,13 +557,13 @@ empty, except for lines starting with #
, which are comments.
List of mods that have to be loaded before loading this mod.
A single line contains a single modname.
Optional dependencies can be defined by appending a question mark -to a single modname. Their meaning is that if the specified mod -is missing, that does not prevent this mod from being loaded.
+to a single modname. This means that if the specified mod +is missing, it does not prevent this mod from being loaded.screenshot.png
A screenshot shown in the mod manager within the main menu. It should have an aspect ratio of 3:2 and a minimum size of 300×200 pixels.
description.txt
A File containing description to be shown within mainmenu.
+A file containing a description to be shown in the Mods tab of the mainmenu.
settingtypes.txt
A file in the same format as the one in builtin. It will be parsed by the settings menu and the settings will be displayed in the "Mods" category.
@@ -595,14 +603,13 @@ be used for overriding the registrations of some other mod.Aliases can be added by using minetest.register_alias(name, convert_to)
or
minetest.register_alias_force(name, convert_to)
.
This will make Minetest to convert things called name to things called
-convert_to
.
This converts anything called name
to convert_to
.
The only difference between minetest.register_alias
and
minetest.register_alias_force
is that if an item called name
exists,
minetest.register_alias
will do nothing while
minetest.register_alias_force
will unregister it.
This can be used for maintaining backwards compatibility.
-This can be also used for setting quick access names for things, e.g. if +
This can also set quick access names for things, e.g. if
you have an item called epiclylongmodname:stuff
, you could do
minetest.register_alias("stuff", "epiclylongmodname:stuff")
@@ -679,7 +686,7 @@ to generate textures on-the-fly.
Example:
default_dirt.png^default_grass_side.png
-default_grass_side.png
is overlayed over default_dirt.png
.
+
default_grass_side.png
is overlaid over default_dirt.png
.
The texture with the lower resolution will be automatically upscaled to
the higher resolution texture.
A box
is defined as:
column_height_min
is not specified, this parameter defaults to 1
If column_height_max
is not specified, this parameter defaults to clust_size
for reverse compatibility. New code should prefer column_height_max
.
The column_midpoint_factor
parameter controls the position of the column at which
-ore eminates from. If 1, columns grow upward. If 0, columns grow downward. If 0.5,
+ore emanates from. If 1, columns grow upward. If 0, columns grow downward. If 0.5,
columns grow equally starting from each direction. column_midpoint_factor
is a
decimal number ranging in value from 0 to 1. If this parameter is not specified,
the default is 0.5.
For the following functions, v
, v1
, v2
are vectors, p1
, p2
are positions:
vector.new(a[, b, c])
: returns a vector:vector.new(a[, b, c])
:
+vector.direction(p1, p2)
:
+vector.distance(p1, p2)
:p1
and p2
.vector.length(v)
:v
.vector.normalize(v)
:
+vector.floor(v)
:vector.round(v)
:vector.apply(v, func)
:func
has been applied to each component.vector.equals(v1, v2)
:true
if the vectors are identical.vector.sort(v1, v2)
:v1
, v2
.vector.direction(p1, p2)
: returns a vectorvector.distance(p1, p2)
: returns a numbervector.length(v)
: returns a numbervector.normalize(v)
: returns a vectorvector.floor(v)
: returns a vector, each dimension rounded downvector.round(v)
: returns a vector, each dimension rounded to nearest intvector.apply(v, func)
: returns a vectorvector.equals(v1, v2)
: returns a booleanvector.sort(v1, v2)
: returns minp, maxp vectors of the cuboid defined by v1 and v2For the following functions x
can be either a vector or a number:
vector.add(v, x)
: returns a vectorvector.subtract(v, x)
: returns a vectorvector.multiply(v, x)
: returns a scaled vector or Schur productvector.divide(v, x)
: returns a scaled vector or Schur quotientvector.add(v, x)
:vector.subtract(v, x)
:vector.multiply(v, x)
:vector.divide(v, x)
:@=
acts as a literal =
. It is not required in strings given to minetest.translate
, but is in translation
- files to avoid begin confused with the =
separating the original from the translation.
+ files to avoid being confused with the =
separating the original from the translation.
@\n
(where the \n
is a literal newline) acts as a literal newline. As with @=
, this escape is not required
in strings given to minetest.translate
, but is in translation files.
* @n
acts as a literal newline as well.
@@ -2736,7 +2797,7 @@ The file should be a text file, with the following format:
hash
: Full git version (only set if available), eg, "1.2.3-dev-01234567-dirty"
Use this for informational purposes only. The information in the returned
table does not represent the capabilities of the engine, nor is it
- reliable or verifyable. Compatible forks will have a different name and
+ reliable or verifiable. Compatible forks will have a different name and
version entirely. To check for the presence of engine features, test
whether the functions exported by the wanted features exist. For example:
if minetest.check_for_falling then ... end
.minetest.register_on_placenode(func(pos, newnode, placer, oldnode, itemstack, pointed_thing))
true
no item is taken from itemstack
true
no item is taken from itemstack
placer
may be any valid ObjectRef or nil.on_construct
or after_place_node
in node definition
whenever possibledir
: unit vector of direction of punch. Always defined. Points from
the puncher to the punched.damage
- number that represents the damage calculated by the enginetrue
to prevent the default damage mechanismtrue
to prevent the default damage mechanismminetest.register_on_player_hpchange(func(player, hp_change), modifier)
minetest.register_on_chat_message(func(name, message))
minetest.register_on_player_receive_fields(func(player, formname, fields))
minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv))
minetest.register_on_item_eat(func(hp_change, replace_with_item, itemstack, user, pointed_thing))
minetest.register_on_priv_grant(function(name, granter, priv))
minetest.register_can_bypass_userlimit(function(name, ip))
minetest.register_on_modchannel_message(func(channel_name, sender, message))
minetest.register_authentication_handler(handler)
@@ -3010,47 +3072,66 @@ The file should be a text file, with the following format:
minetest.notify_authentication_modified(name)
name
: string, if omitted, everybody is reportedminetest.check_password_entry(name, entry, password)
minetest.get_password_hash(name, raw_password)
minetest.check_password_entry
instead.minetest.string_to_privs(str)
: returns {priv1=true,...}
minetest.privs_to_string(privs)
: returns "priv1,priv2,..."
minetest.set_player_password(name, password_hash)
minetest.set_player_privs(name, {priv1=true,...})
minetest.get_player_privs(name) -> {priv1=true,...}
minetest.auth_reload()
minetest.check_player_privs(player_or_name, ...)
: returns bool, missing_privs
minetest.check_player_privs(player_or_name, ...)
: returns bool, missing_privs
player_or_name
: Either a Player object or the name of a player....
is either a list of strings, e.g. "priva", "privb"
or
a table, e.g. { priva = true, privb = true }
.minetest.get_player_ip(name)
: returns an IP address stringminetest.check_password_entry(name, entry, password)
get_auth()
call on the auth handler.minetest.get_password_hash(name, raw_password)
minetest.check_password_entry
instead.minetest.get_player_ip(name)
: returns an IP address string for the player name
minetest.get_auth_handler()
: Return the currently active auth handler
minetest.notify_authentication_modified(name)
name
: string; if omitted, all auth data should be considered modifiedminetest.set_player_password(name, password_hash)
: Set password hash of player name
minetest.set_player_privs(name, {priv1=true,...})
: Set privileges of player name
minetest.auth_reload()
reload()
in authentication handler definitionminetest.set_player_password
, minetest_set_player_privs
, minetest_get_player_privs
and minetest.auth_reload
call the authentication handler.
minetest.auth_reload
call the authentication handler.
minetest.dig_node(pos)
minetest.punch_node(pos)
minetest.auth_reload
call the authentication handler.
minetest.line_of_sight(pos1, pos2, stepsize)
: returns boolean, pos
pos1
and pos2
minetest.line_of_sight(pos1, pos2)
: returns boolean, pos
false
pos1
: First positionpos1
: First positionpos2
: Second positionstepsize
: smaller gives more accurate results but requires more computing
- time. Default is 1
.minetest.raycast(pos1, pos2, objects, liquids)
: returns Raycast
Raycast
object.pos1
: start of the raypos1
: start of the raypos2
: end of the rayobjects
: if false, only nodes will be returned. Default is true
.liquids' : if false, liquid nodes won't be returned. Default is
false`.minetest.auth_reload
call the authentication handler.
minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)
pos1
to pos2
or nil
pos1
: start positionpos1
to pos2
or nil
pos1
: start positionpos2
: end positionsearchdistance
: number of blocks to search in each direction using a maximum metricmax_jump
: maximum height difference to consider walkableminetest.auth_reload
call the authentication handler.
pos1
is the corner of the cuboid with the least coordinates
+pos1
is the corner of the cuboid with the least coordinates
(in node coordinates), inclusive.pos2
is the opposite corner of the cuboid, inclusive.minetest.auth_reload
call the authentication handler.
minetest.is_colored_paramtype(ptype)
minetest.auth_reload
call the authentication handler.
minetest.after(time, func, ...)
minetest.auth_reload
call the authentication handler.
minetest.get_server_status()
: returns server status stringminetest.get_server_uptime()
: returns the server uptime in secondsminetest.remove_player(name)
: remove player from database (if he is not connected).minetest.remove_player_auth(name)
: remove player authentication dataminetest.auth_reload
call the authentication handler.
force_placement
is a boolean indicating whether nodes other than air
and
ignore
are replaced by the schematicminetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement)
:
vmanip
instead of the whole map.minetest.auth_reload
call the authentication handler.
minetest.is_protected(pos, name)
: returns boolean
name
shouldn't be abled to dig at pos
or do other
- actions, defineable by mods, due to some mod-defined ownership-like concept.
+ actions, definable by mods, due to some mod-defined ownership-like concept.
Returns false or nil, if the player is allowed to do such actions.name
will be "" for non-players or unknown players.minetest.forceload_block(pos[, transient])
pos
.true
if area could be forceloadedtrue
if area could be forceloadedtransient
is false
or absent, the forceload will be persistent
(saved between server runs). If true
, the forceload will be transient
(not saved between server runs).from_table(nil or {})
equals(other)
minetest.get_node_timer(pos)
.
is_started()
: returns boolean state of timer
minetest.get_node_timer(pos)
.
hud_set_flags(flags)
: sets specified HUD flags to true
/false
flags
: (is visible) hotbar
, healthbar
, crosshair
, wielditem
, breathbar
,
minimap
, minimap_radar
true
/false
value of each flag to be set or unsettrue
/false
value of each flag to be set or unsetnil
, the flag is not modifiedminimap
modifies the client's permission to view the minimap -minetest.get_node_timer(pos)
.
get_day_night_ratio()
: returns the ratio or nil if it isn't overriddenset_local_animation(stand/idle, walk, dig, walk+dig, frame_speed=frame_speed)
set animation for player model in third person view
-set_local_animation({x=0, y=79}, -- < stand/idle animation key frames
+#set_local_animation(stand/idle, walk, dig, walk+dig, frame_speed=frame_speed)
:
+ set animation for player model in third person viewset_local_animation({x=0, y=79}, -- < stand/idle animation key frames
{x=168, y=187}, -- < walk animation key frames
{x=189, y=198}, -- < dig animation key frames
{x=200, y=219}, -- < walk+dig animation key frames
@@ -4682,8 +4769,8 @@ Alternatively with minetest.get_perlin(seeddiff, octaves, persistence, sca
or minetest.get_perlin(noiseparams)
.
Methods
-- #
get2d(pos)
: returns 2D noise value at pos={x=,y=}
-- #
get3d(pos)
: returns 3D noise value at pos={x=,y=,z=}
+- #
get_2d(pos)
: returns 2D noise value at pos={x=,y=}
+- #
get_3d(pos)
: returns 3D noise value at pos={x=,y=,z=}
PerlinNoiseMap
A fast, bulk perlin noise generator.
@@ -4696,25 +4783,25 @@ for 2D noise, and it must be must be larger than 1 for 3D noise (otherwise
nil, this table will be used to store the result instead of creating a new table.
Methods
-- #
get2dMap(pos)
: returns a <size.x>
times <size.y>
2D array of 2D noise
+ - #
get_2d_map(pos)
: returns a <size.x>
times <size.y>
2D array of 2D noise
with values starting at pos={x=,y=}
-- #
get3dMap(pos)
: returns a <size.x>
times <size.y>
times <size.z>
3D array
+ - #
get_3d_map(pos)
: returns a <size.x>
times <size.y>
times <size.z>
3D array
of 3D noise with values starting at pos={x=,y=,z=}
-- #
get2dMap_flat(pos, buffer)
: returns a flat <size.x * size.y>
element array of 2D noise
+ - #
get_2d_map_flat(pos, buffer)
: returns a flat <size.x * size.y>
element array of 2D noise
with values starting at pos={x=,y=}
-- #
get3dMap_flat(pos, buffer)
: Same as get2dMap_flat
, but 3D noise
-- #
calc2dMap(pos)
: Calculates the 2d noise map starting at pos
. The result is stored internally.
-- #
calc3dMap(pos)
: Calculates the 3d noise map starting at pos
. The result is stored internally.
-- #
getMapSlice(slice_offset, slice_size, buffer)
: In the form of an array, returns a slice of the
+ - #
get_3d_map_flat(pos, buffer)
: Same as get2dMap_flat
, but 3D noise
+- #
calc_2d_map(pos)
: Calculates the 2d noise map starting at pos
. The result is stored internally.
+- #
calc_3d_map(pos)
: Calculates the 3d noise map starting at pos
. The result is stored internally.
+- #
get_map_slice(slice_offset, slice_size, buffer)
: In the form of an array, returns a slice of the
most recently computed noise results. The result slice begins at coordinates slice_offset
and
takes a chunk of slice_size
.
E.g. to grab a 2-slice high horizontal 2d plane of noise starting at buffer offset y = 20:
- noisevals = noise:getMapSlice({y=20}, {y=2})
+ noisevals = noise:get_map_slice({y=20}, {y=2})
It is important to note that slice_offset
offset coordinates begin at 1, and are relative to
the starting position of the most recently calculated noise.
To grab a single vertical column of noise starting at map coordinates x = 1023, y=1000, z = 1000:
- noise:calc3dMap({x=1000, y=1000, z=1000})
-noisevals = noise:getMapSlice({x=24, z=1}, {x=1, z=1})
+ noise:calc_3d_map({x=1000, y=1000, z=1000})
+noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})
VoxelManip
About VoxelManip
@@ -4871,7 +4958,7 @@ will place the schematic inside of the VoxelManip.
#set_lighting(light, [p1, p2])
: Set the lighting within the VoxelManip
to a uniform value
@@ -4894,7 +4981,7 @@ will place the schematic inside of the VoxelManip.
#set_param2_data(param2_data)
: Sets the param2
contents of each node in the VoxelManip
#calc_lighting([p1, p2], [propagate_shadow])
: Calculate lighting within the VoxelManip
- #To be used only by a
VoxelManip
object from minetest.get_mapgen_object
-- #(
p1
, p2
) is the area in which lighting is set; defaults to the whole area
+ - #(
p1
, p2
) is the area in which lighting is set; defaults to the whole area
if left out or nil
- #
propagate_shadow
is an optional boolean deciding whether shadows in a generated
mapchunk above are propagated down into the mapchunk; defaults to true
if left out
@@ -4937,7 +5024,11 @@ The coordinates are inclusive, like most other things in Minetest.
Methods
- #
get(key)
: returns a value
-- #
get_bool(key)
: returns a boolean
+- #
get_bool(key, [default])
: returns a boolean
+
- #
get_np_group(key)
: returns a NoiseParams table
- #
set(key, value)
- Setting names can't contain whitespace or any of
="{}#
.
@@ -5143,8 +5234,13 @@ minetest.spawn_tree(pos,apple_tree)
-- ^ For players: Defaults to `minetest.PLAYER_MAX_HP_DEFAULT`
breath_max = 0,
-- ^ For players only. Defaults to `minetest.PLAYER_MAX_BREATH_DEFAULT`
- can_zoom = true,
--- ^ For players only. Enables the zoom feature. Defaults to true
+ zoom_fov = 0.0,
+-- ^ For players only. Zoom FOV in degrees.
+-- Note that zoom loads and/or generates world beyond the server's maximum
+-- send and generate distances, so acts like a telescope.
+-- Smaller zoomFOV values increase the distance loaded and/or generated.
+-- Defaults to 15 in creative mode, 0 in survival mode.
+-- zoom_fov = 0 disables zooming for the player.
eye_height = 1.625,
-- ^ For players only. Camera height above feet position in nodes. Defaults to 1.625
physical = true,
@@ -5152,18 +5248,37 @@ minetest.spawn_tree(pos,apple_tree)
weight = 5,
collisionbox = {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5},
selectionbox = {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5},
--- ^ Default, uses collision box dimensions when not set
+-- ^ Default, uses collision box dimensions when not set.
+-- ^ For both boxes: {xmin, ymin, zmin, xmax, ymax, zmax} in nodes from
+-- object position.
pointable = true, -- overrides selection box when false
visual = "cube" / "sprite" / "upright_sprite" / "mesh" / "wielditem",
+-- ^ "cube" is a node-sized cube.
+-- ^ "sprite" is a flat texture always facing the player.
+-- ^ "upright_sprite" is a vertical flat texture.
+-- ^ "mesh" uses the defined mesh model.
visual_size = {x = 1, y = 1},
+-- ^ `x` multiplies horizontal (X and Z) visual size.
+-- ^ `y` multiplies vertical (Y) visual size.
mesh = "model",
textures = {}, -- number of required textures depends on visual
+-- ^ "cube" uses 6 textures in the way a node does.
+-- ^ "sprite" uses 1 texture.
+-- ^ "upright_sprite" uses 2 textures: {front, back}.
colors = {}, -- number of required colors depends on visual
spritediv = {x = 1, y = 1},
+-- ^ Used with spritesheet textures for animation and/or frame selection according
+-- to position relative to player.
+-- ^ Defines the number of columns and rows in the spritesheet: {columns, rows}.
initial_sprite_basepos = {x = 0, y = 0},
+-- ^ Used with spritesheet textures.
+-- ^ Defines the {column, row} position of the initially used frame in the
+-- spritesheet.
is_visible = true,
makes_footstep_sound = false,
- automatic_rotate = false,
+ automatic_rotate = 0,
+-- ^ Set constant rotation in radians per second, positive or negative.
+-- ^ Set to 0 to disable constant rotation.
stepheight = 0,
automatic_face_movement_dir = 0.0,
-- ^ Automatically set yaw to movement direction, offset in degrees,
@@ -5208,19 +5323,30 @@ minetest.spawn_tree(pos,apple_tree)
ABM (ActiveBlockModifier) definition (register_abm
)
{
label = "Lava cooling",
--- ^ Descriptive label for profiling purposes (optional).
--- Definitions with identical labels will be listed as one.
--- In the following two fields, also group:groupname will work.
+ ^ Descriptive label for profiling purposes (optional).
+ Definitions with identical labels will be listed as one.
nodenames = {"default:lava_source"},
- neighbors = {"default:water_source", "default:water_flowing"}, -- Any of these --[[
- ^ If left out or empty, any neighbor will do ]]
- interval = 1.0, -- Operation interval in seconds
- chance = 1, -- Chance of trigger per-node per-interval is 1.0 / this
- catch_up = true, -- If true, catch-up behaviour is enabled --[[
- ^ The chance value is temporarily reduced when returning to
- an area to simulate time lost by the area being unattended.
- ^ Note chance value can often be reduced to 1 ]]
- action = func(pos, node, active_object_count, active_object_count_wider),
+ ^ Apply `action` function to these nodes.
+ ^ `group:groupname` can also be used here.
+ neighbors = {"default:water_source", "default:water_flowing"},
+ ^ Only apply `action` to nodes that have one of, or any
+ combination of, these neighbors.
+ ^ If left out or empty, any neighbor will do.
+ ^ `group:groupname` can also be used here.
+ interval = 1.0,
+ ^ Operation interval in seconds.
+ chance = 1,
+ ^ Chance of triggering `action` per-node per-interval is 1.0 / this value.
+ catch_up = true,
+ ^ If true, catch-up behaviour is enabled: The `chance` value is temporarily
+ reduced when returning to an area to simulate time lost by the area being
+ unattended. Note that the `chance` value can often be reduced to 1.
+ action = function(pos, node, active_object_count, active_object_count_wider),
+ ^ Function triggered for each qualifying node.
+ ^ `active_object_count` is number of active objects in the node's mapblock.
+ ^ `active_object_count_wider` is number of active objects in the node's
+ mapblock plus all 26 neighboring mapblocks. If any neighboring mapblocks
+ are unloaded an estmate is calculated for them based on loaded mapblocks.
}
LBM (LoadingBlockModifier) definition (register_lbm
)
@@ -5527,11 +5653,18 @@ minetest.spawn_tree(pos,apple_tree)
^ interval. Default: nil.
^ Warning: making a liquid node 'floodable' does not work and may cause problems. ]]
+preserve_metadata = func(pos, oldnode, oldmeta, drops) --[[
+^ Called when oldnode is about be converted to an item, but before the
+ node is deleted from the world or the drops are added. This is generally
+ the result of either the node being dug or an attached node becoming detached.
+^ drops is a table of ItemStacks, so any metadata to be preserved can be
+ added directly to one or more of the dropped items. See "ItemStackMetaRef".
+^ default: nil ]]
after_place_node = func(pos, placer, itemstack, pointed_thing) --[[
^ Called after constructing node when node was placed using
minetest.item_place_node / minetest.place_node
^ If return true no item is taken from itemstack
-^ `placer` may be any valid ObjectRef or nil
+ ^ `placer` may be any valid ObjectRef or nil
^ default: nil ]]
after_dig_node = func(pos, oldnode, oldmetadata, digger), --[[
^ oldmetadata is in table format
@@ -5752,18 +5885,18 @@ minetest.spawn_tree(pos,apple_tree)
y_min = 1,
y_max = 31000,
-- ^ Lower and upper limits for biome.
+ vertical_blend = 8,
+-- ^ Vertical distance in nodes above 'y_max' over which the biome will
+-- ^ blend with the biome above.
+-- ^ Set to 0 for no vertical blend. Defaults to 0.
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.
+-- ^ Characteristic temperature and humidity for the biome.
+-- ^ These values create 'biome points' on a voronoi diagram with heat and
+-- ^ humidity as axes. The resulting voronoi cells determine the
+-- ^ distribution of the 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 Celsius, both values are abstract.
+-- ^ 0 and 100 but can exceed these values.
}
register_decoration
){
+ get_auth = func(name),
+-- ^ Get authentication data for existing player `name` (`nil` if player doesn't exist)
+-- ^ returns following structure `{password=<string>, privileges=<table>, last_login=<number or nil>}`
+ create_auth = func(name, password),
+-- ^ Create new auth data for player `name`
+-- ^ Note that `password` is not plain-text but an arbitrary representation decided by the engine
+ delete_auth = func(name),
+-- ^ Delete auth data of player `name`, returns boolean indicating success (false if player nonexistant)
+ set_password = func(name, password),
+-- ^ Set password of player `name` to `password`
+ Auth data should be created if not present
+ set_privileges = func(name, privileges),
+-- ^ Set privileges of player `name`
+-- ^ `privileges` is in table form, auth data should be created if not present
+ reload = func(),
+-- ^ Reload authentication data from the storage location
+-- ^ Returns boolean indicating success
+ record_login = func(name),
+-- ^ Called when player joins, used for keeping track of last_login
+ iterate = func(),
+-- ^ Returns an iterator (use with `for` loops) for all player names currently in the auth database
+}
\ No newline at end of file
diff --git a/update_lua_api.py b/update_lua_api.py
index d672a51..0b780dd 100644
--- a/update_lua_api.py
+++ b/update_lua_api.py
@@ -34,8 +34,8 @@ text = unicode(text, "utf-8")
print("Pre-generation replacements...")
-header = """Minetest Lua Modding API Reference 0.5.0
-========================================="""
+header = """Minetest Lua Modding API Reference
+=================================="""
text = text.replace(header, "")
#