Default: New grass textures, new footprint overlay texture
[oweals/minetest_game.git] / game_api.txt
index 99c34a78dd200f0e4cf1ba320ee22f258a48853b..791a7f924d27d96277bb216cb91e6c9bad921adb 100644 (file)
@@ -144,6 +144,21 @@ farming.register_plant(name, Plant definition)
        maxlight = default.LIGHT_MAX -- Maximum light to grow
 }
 
+Screwdriver API
+---------------
+The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it.
+To use it, add the on_screwdriver function to the node definition.
+on_rotate(pos, node, user, mode, new_param2)
+^ pos: position of the node that the screwdriver is being used on
+^ node: that node
+^ user: the player who used the screwdriver
+^ mode: screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS
+^ new_param2: the new value of param2 that would have been set if on_rotate wasn't there
+^ return value: false to disallow rotation, nil to keep default behaviour, true to allow
+  it but to indicate that changed have already been made (so the screwdriver will wear out)
+^ use on_rotate = screwdriver.disallow to always disallow rotation
+^ use on_rotate = screwdriver.rotate_simple to allow only face rotation
+
 Stairs API
 ----------
 The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
@@ -194,6 +209,24 @@ xpanes.register_pane(subname, def)
        ^ Recipe field only
 }
 
+Raillike definitions
+--------------------
+The following nodes use the group `connect_to_raillike` and will only connect to
+raillike nodes within this group and the same group value.
+Use `minetest.raillike_group(<Name>)` to get the group value.
+
+| Node type            | Raillike group name
++-----------------------+----------------------------------
+| default:rail         | "rail"
+| tnt:gunpowder                | "gunpowder"
+| tnt:gunpowder_burning        | "gunpowder"
+
+Example:
+If you want to add a new rail type and want it to connect with default:rail,
+add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` table
+of your node.
+
+
 Default sounds
 --------------
 Sounds inside the default table can be used within the sounds field of node definitions.