diff --git a/lua_api.html b/lua_api.html index 2f30c81..fded574 100644 --- a/lua_api.html +++ b/lua_api.html @@ -4,7 +4,7 @@ layout: default ---
If you have any difficulty in understanding this, please read Programming in Lua.
#
, which are comments.
to a single modname. Their meaning is that if the specified mod
is missing, that does not prevent this mod from being loaded.
screenshot.png
A screenshot shown in modmanager within mainmenu.
+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.
settingtypes.txt
Example:
default_sandstone.png^[resize:16x16
+[opacity:<r>
Makes the base image transparent according to the given ratio.
+r must be between 0 and 255.
+0 means totally transparent.
+255 means totally opaque.
+
+Example:
+default_sandstone.png^[opacity:127
+
[brighten
Brightens the texture.
Example:
@@ -862,6 +873,22 @@ paramtype2 == "degrotate" ^ The rotation of this node is stored in param2. Plants are rotated this way. Values range 0 - 179. The value stored in param2 is multiplied by two to get the actual rotation of the node. +paramtype2 == "meshoptions" +^ Only valid for "plantlike". The value of param2 becomes a bitfield which can + be used to change how the client draws plantlike nodes. Bits 0, 1 and 2 form + a mesh selector. Currently the following meshes are choosable: + 0 = a "x" shaped plant (ordinary plant) + 1 = a "+" shaped plant (just rotated 45 degrees) + 2 = a "*" shaped plant with 3 faces instead of 2 + 3 = a "#" shaped plant with 4 faces instead of 2 + 4 = a "#" shaped plant with 4 faces that lean outwards + 5-7 are unused and reserved for future meshes. + Bits 3 through 7 are optional flags that can be combined and give these + effects: + bit 3 (0x08) - Makes the plant slightly vary placement horizontally + bit 4 (0x10) - Makes the plant mesh 1.4x larger + bit 5 (0x20) - Moves each face randomly a small bit down (1/8 max) + bits 6-7 are reserved for future use. collision_box = { type = "fixed", fixed = { @@ -1648,19 +1675,25 @@ list[current_player;craftpreview;7,1;1,1;]true
the background is clipped to formspec size
(x
and y
are used as offset values, w
and h
are ignored)pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]
pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>;<close_on_enter>]
x
and y
position the field relative to the top left of the menuw
and h
are the size of the fieldh
name
is the name of the field as returned in fields to on_receive_fields
label
, if not blank, will be text printed on the top left above the fieldclose_on_enter
(optional) is whether the form should accept and close when enter is
+ pressed in this field. Defaults to true.field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]
field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>;<close_on_enter>]
x
and y
position the field relative to the top left of the menuw
and h
are the size of the fieldh
close_on_enter
(optional) is whether the form should accept and close when enter is
+ pressed in this field. Defaults to true.field[<name>;<label>;<default>]
field[<name>;<label>;<default>;<close_on_enter>]
size[]
elementclose_on_enter
(optional) is whether the form should accept and close when enter is
+ pressed in this field. Defaults to true.textarea[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]
minetest.register_privilege(name, definition)
minetest.get_meta(pos)
.
get_inventory()
: returns InvRef
to_table()
: returns nil
or {fields = {...}, inventory = {list1 = {}, ...}}
from_table(nil or {})
register_node
, register_craftitem
, register_tool
){
description = "Steel Axe",
- groups = {}, -- key=name, value=rating; rating=1..3.
+ groups = {}, -- key = name, value = rating; rating = 1..3.
if rating not applicable, use 1.
- e.g. {wool=1, fluffy=3}
- {soil=2, outerspace=1, crumbly=1}
- {bendy=2, snappy=1},
- {hard=1, metal=1, spikes=1}
+ e.g. {wool = 1, fluffy = 3}
+ {soil = 2, outerspace = 1, crumbly = 1}
+ {bendy = 2, snappy = 1},
+ {hard = 1, metal = 1, spikes = 1}
inventory_image = "default_tool_steelaxe.png",
wield_image = "",
- wield_scale = {x=1,y=1,z=1},
+ wield_scale = {x = 1, y = 1, z = 1},
stack_max = 99,
range = 4.0,
liquids_pointable = false,
tool_capabilities = {
full_punch_interval = 1.0,
- max_drop_level=0,
- groupcaps={
+ max_drop_level = 0,
+ groupcaps = {
-- For example:
- snappy={times={[2]=0.80, [3]=0.40}, maxwear=0.05, maxlevel=1},
- choppy={times={[3]=0.90}, maxwear=0.05, maxlevel=0}
+ choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, uses = 20, maxlevel = 2},
},
- damage_groups = {groupname=damage},
+ damage_groups = {groupname = damage},
},
node_placement_prediction = nil,
--[[
diff --git a/update_lua_api.py b/update_lua_api.py
index 00f2599..661b388 100644
--- a/update_lua_api.py
+++ b/update_lua_api.py
@@ -29,6 +29,7 @@ print("Downloading lua_api.txt...")
url = "https://raw.githubusercontent.com/minetest/minetest/master/doc/lua_api.txt"
text = urllib2.urlopen(url).read()
+text = unicode(text, "utf-8")
print("Pre-generation replacements...")