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
  • Recipe for register_craft (cooking)
  • Recipe for register_craft (furnace fuel)
  • Ore definition (register_ore)
  • +
  • Biome definition (register_biome)
  • Decoration definition (register_decoration)
  • Chat command definition (register_chatcommand)
  • Detached inventory callbacks
  • @@ -353,7 +354,7 @@ source code patches to celeron55@gmail.com< This page was last updated 22/November/2015.
    See doc/lua_api.txt for the latest version (in plaintext).
    Generated using a Python script.

    Programming in Lua

    +This page was last updated 07/December/2015.
    See doc/lua_api.txt for the latest version (in plaintext).
    Generated using a Python script.

    Programming in Lua

    If you have any difficulty in understanding this, please read Programming in Lua.

    Startup

    @@ -998,7 +999,7 @@ parameters 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:

    +

    Example 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.
  • #minetest.string_to_privs(str): returns {priv1=true,...}
  • @@ -2537,7 +2546,7 @@ and minetest.auth_reload call the authetification handler.

  • #playername: name of player to show formspec
  • #formname: name passed to on_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
  • -
  • #set_lighting(light, p1, p2): Set the lighting within the VoxelManip to a uniform value
  • +

    Biome definition (register_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.
    +}
    +

    Decoration definition (register_decoration)

    {
         deco_type = "simple", -- See "Decoration types"