Insta-drop minecart when its rail is destroyed
[MineClone/MineClone2.git] / mods / ITEMS / mcl_walls / API.md
blobe6956ac47901a34d1c5aef59111680193d4776b0
1 # API for MineClone 2 walls
3 This API allows you to add more walls (like the cobblestone wall) to MineClone 2.
5 ## `mcl_walls.register_wall(nodename, description, craft_material, tiles, invtex, groups, sounds)`
7 Adds a new wall type. This is optimized for stone-based walls, but other materials are theoretically possible, too.
9 The current implementation registers a couple of nodes for the different nodeboxes.
10 All walls connect to solid nodes and all other wall nodes.
12 If `craft_material` is not `nil` it also adds a crafting recipe of the following form:
14     CCC
15     CCC
16     
17     Yields 6 walls
18     C = craft_material (can be group)
20 ### Parameters
21 * `nodename`: Full itemstring of the new wall node (base node only). ***Must not have an underscore!***
22 * `description`: Item description of item (tooltip), visible to user
23 * `source`: Node on which the wall is based off, use for texture and crafting recipe (optional)
24 * `tiles`: Wall textures table, same syntax as for `minetest.register_node` (optional if `source` is set)
25 * `inventory_image`: Inventory image (optional if `source` is set)
26 * `groups`: Base group memberships (optional, default is `{pickaxey=1}`)
27 * `sounds`: Sound table (optional, by default default uses stone sounds)
29 The following groups will automatically be added to the nodes (where applicable), you do not need to add them
30 to the `groups` table:
32 * `deco_block=1`
33 * `not_in_creative_inventory=1` (except for the base node which the player can take)
34 * `wall=1`
36 ### Example
38     mcl_walls.register_wall("mymod:granitewall", "Granite Wall", {"mymod_granite.png"}, "mymod_granite_wall_inv.png")