Default: Make burntimes more rational and consistent
[oweals/minetest_game.git] / game_api.txt
index 0d518f1c884a70607a8f587bec78eff80aebfe12..d33c7c968f3651863d0be08c01b2816691878709 100644 (file)
@@ -155,7 +155,8 @@ The doors mod allows modders to register custom doors and trapdoors.
 ### Fence gate definition
 
        description = "Wooden Fence Gate",
-       texture = "default_wood.png",
+       texture = "default_wood.png", -- `backface_culling` will automatically be
+                                     -- set to `true` if not specified.
        material = "default:wood",
        groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
        sounds = default.node_sound_wood_defaults(), -- optional
@@ -282,18 +283,6 @@ Give Initial Stuff API
 ^ str is a comma separated list of initial stuff
 ^ Adds items to the list of items to be given
 
-Nyancat API
------------
-
-`nyancat.place(pos, facedir, length)`
-
-^ Place a cat at `pos` facing `facedir` with tail length `length`
-  Only accepts facedir 0-3, if facedir > 3 then it will be interpreted as facedir = 0
-
-`nyancat.generate(minp, maxp, seed)`
-
-^ Called by `minetest.register_on_generated`. To disable nyancat generation,
-  you can redefine nyancat.generate() to be an empty function
 
 TNT API
 ----------
@@ -315,17 +304,20 @@ TNT API
   * `bottom` Bottom tile. By default the name of the tnt with a suffix of `_bottom.png`.
   * `burning` Top tile when lit. By default the name of the tnt with a suffix of `_top_burning_animated.png".
 
-`tnt.boom(position, definition)`
+`tnt.boom(position[, definition])`
 
 ^ Create an explosion.
 
 * `position` The center of explosion.
-* `definition` The TNT definion as passed to `tnt.register`
+* `definition` The TNT definion as passed to `tnt.register` with the following addition:
+ * `explode_center` false by default which removes TNT node on blast, when true will explode center node.
 
 `tnt.burn(position, [nodename])`
 
-^ Ignite TNT at position, nodename isn't required unless already known.
-
+^ Ignite node at position, triggering its `on_ignite` callback (see fire mod).
+If no such callback exists, fallback to turn tnt group nodes to their
+"_burning" variant.
+  nodename isn't required unless already known.
 
 To make dropping items from node inventories easier, you can use the
 following helper function from 'default':
@@ -658,20 +650,36 @@ default.player_get_animation(player)
 Leafdecay
 ---------
 
-To enable leaf decay for a node, add it to the `leafdecay` group.
+To enable leaf decay for leaves when a tree is cut down by a player,
+register the tree with the default.register_leafdecay(leafdecaydef)
+function.
+
+If `param2` of any registered node is ~= 0, the node will always be
+preserved. Thus, if the player places a node of that kind, you will
+want to set `param2 = 1` or so.
+
+The function `default.after_place_leaves` can be set as
+`after_place_node of a node` to set param2 to 1 if the player places
+the node (should not be used for nodes that use param2 otherwise
+(e.g. facedir)).
 
-The rating of the group determines how far from a node in the group `tree`
-the node can be without decaying.
+If the node is in the `leafdecay_drop` group then it will always be
+dropped as an item.
 
-If `param2` of the node is ~= 0, the node will always be preserved. Thus, if
-the player places a node of that kind, you will want to set `param2 = 1` or so.
+`default.register_leafdecay(leafdecaydef)`
 
-The function `default.after_place_leaves` can be set as `after_place_node of a node`
-to set param2 to 1 if the player places the node (should not be used for nodes
-that use param2 otherwise (e.g. facedir)).
+`leafdecaydef` is a table, with following members:
+       {
+               trunks = {"default:tree"}, -- nodes considered trunks
+               leaves = {"default:leaves", "default:apple"},
+                       -- nodes considered for removal
+               radius = 3, -- radius to consider for searching
+       }
+
+Note: all the listed nodes in `trunks` have their `on_after_destruct`
+callback overridden. All the nodes listed in `leaves` have their
+`on_timer` callback overridden.
 
-If the node is in the `leafdecay_drop` group then it will always be dropped as an
-item.
 
 Dyes
 ----
@@ -762,14 +770,20 @@ Trees
  * `default.grow_new_pine_tree(pos)`
   * Grows a new design pine tree at pos
 
+ * `default.grow_new_snowy_pine_tree(pos)`
+  * Grows a new design snowy pine tree at pos
+
  * `default.grow_new_acacia_tree(pos)`
   * Grows a new design acacia tree at pos
 
  * `default.grow_new_aspen_tree(pos)`
   * Grows a new design aspen tree at pos
 
- * `default.grow_new_snowy_pine_tree(pos)`
-  * Grows a new design snowy pine tree at pos
+ * `default.grow_bush(pos)`
+  * Grows a bush at pos
+
+ * `default.grow_acacia_bush(pos)`
+  * Grows an acaia bush at pos
 
 Carts
 -----