diff --git a/lua_api.html b/lua_api.html index 8f3b120..f8ac3ae 100644 --- a/lua_api.html +++ b/lua_api.html @@ -38,7 +38,7 @@ layout: default
  • Texture grouping
  • Advanced texture modifiers
  • @@ -354,7 +358,7 @@ source code patches to celeron55@gmail.com< 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

    +This page was last updated 19/March/2016.
    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

    @@ -552,16 +556,16 @@ texture is overlaid over cobble.png.

    Example:

    default_cobble.png^[crack:10:1
     
    -

    [combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>

    +

    [combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>:...

    -

    Create a texture of size <w> times <h> and blit <file1> to (<x1>,<y1>) -and blit <file2> to (<x2>,<y2>).

    +

    Creates a texture of size <w> times <h> and blits the listed files to their +specified coordinates.

    Example:

    [combine:16x32:0,0=default_cobble.png:0,16=default_wood.png
     
    @@ -896,6 +900,18 @@ changed in the future.

    wall_bottom = box, wall_side = box } +{ + -- A node that has optional boxes depending on neighbouring nodes' + -- presence and type. See also `connects_to`. + type = "connected", + fixed = box OR {box1, box2, ...} + connect_top = box OR {box1, box2, ...} + connect_bottom = box OR {box1, box2, ...} + connect_front = box OR {box1, box2, ...} + connect_left = box OR {box1, box2, ...} + connect_back = box OR {box1, box2, ...} + connect_right = box OR {box1, box2, ...} +}

    A box is defined as:

    {x1, y1, z1, x2, y2, z2}
    @@ -1613,7 +1629,7 @@ list[current_player;craftpreview;7,1;1,1;]
     

    pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]

    Entity definition (register_entity)

    @@ -3924,6 +4000,20 @@ minetest.spawn_tree(pos,apple_tree) action = func(pos, node, active_object_count, active_object_count_wider), } +

    LBM (LoadingBlockModifier) definition (register_lbm)

    +
    {
    +    name = "modname:replace_legacy_door",
    +    nodenames = {"default:lava_source"},
    +--  ^ List of node names to trigger the LBM on.
    +--    Also non-registered nodes will work.
    +--    Groups (as of group:groupname) will work as well.
    +    run_at_every_load = false,
    +--  ^ Whether to run the LBM's action every time a block gets loaded,
    +--    and not just for blocks that were saved last time before LBMs were
    +--    introduced to the world.
    +    action = func(pos, node),
    +}
    +

    Item definition (register_node, register_craftitem, register_tool)

    {
         description = "Steel Axe",
    @@ -4003,7 +4093,7 @@ minetest.spawn_tree(pos,apple_tree)
     
  • #{name="image.png", animation={Tile Animation definition}}
  • #{name="image.png", backface_culling=bool, tileable_vertical=bool, tileable_horizontal=bool}
  • +

    HTTPRequest definition (http_fetch, http_fetch_async)

    +
    {
    +    url = "http://example.org",
    +    timeout = 10,
    + -- ^ Timeout for connection in seconds. Default is 3 seconds.
    +    post_data = "Raw POST request data string" OR { field1 = "data1", field2 = "data2" },
    + -- ^ Optional, if specified a POST request with post_data is performed.
    + -- ^ Accepts both a string and a table. If a table is specified, encodes table
    + -- ^ as x-www-form-urlencoded key-value pairs.
    + -- ^ If post_data ist not specified, a GET request is performed instead.
    +    user_agent = "ExampleUserAgent",
    + -- ^ Optional, if specified replaces the default minetest user agent with given string
    +    extra_headers = { "Accept-Language: en-us", "Accept-Charset: utf-8" },
    + -- ^ Optional, if specified adds additional headers to the HTTP request. You must make sure
    + -- ^ that the header strings follow HTTP specification ("Key: Value").
    +    multipart = boolean
    + -- ^ Optional, if true performs a multipart HTTP request. Default is false.
    +}
    +
    +

    HTTPRequestResult definition (http_fetch callback, http_fetch_async_get)

    +
    {
    +    completed = true,
    + -- ^ If true, the request has finished (either succeeded, failed or timed out)
    +    succeeded = true,
    + -- ^ If true, the request was succesful
    +    timeout = false,
    + -- ^ If true, the request timed out
    +    code = 200,
    + -- ^ HTTP status code
    +    data = "response"
    +}
     
    \ No newline at end of file