diff options
author | RealBadAngel <mk@realbadangel.pl> | 2013-04-11 03:36:38 +0200 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2013-04-10 22:33:59 -0400 |
commit | e7f5cdf9d4cbe17a2a42015e072a791659b3886b (patch) | |
tree | f94bd685c3cc4e5ccd89893e5387dae17df9e998 /doc | |
parent | dda2071cc083db2770044db85174a8629a7598b7 (diff) | |
download | minetest-e7f5cdf9d4cbe17a2a42015e072a791659b3886b.tar.gz minetest-e7f5cdf9d4cbe17a2a42015e072a791659b3886b.tar.bz2 minetest-e7f5cdf9d4cbe17a2a42015e072a791659b3886b.zip |
Bugfixes to get_craft_recipe and get_all_craft_recipes.
Improvements to get_all_craft_recipes (see api doc)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 285f3d205..b29c50379 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1002,10 +1002,23 @@ minetest.get_craft_recipe(output) -> input ^ input.items = for example { stack 1, stack 2, stack 3, stack 4, stack 5, stack 6, stack 7, stack 8, stack 9 } ^ input.items = nil if no recipe found -minetest.get_all_craft_recipes(output) -> table or nil -^ returns table with all registered recipes for output item (node) -^ returns nil if no recipe was found -^ table entries have same format as minetest.get_craft_recipe +minetest.get_all_craft_recipes(query item) -> table or nil +^ returns indexed table with all registered recipes for query item (node) + or nil if no recipe was found + recipe entry table: + { + method = 'normal' or 'cooking' or 'fuel' + width = 0-3, 0 means shapeless recipe + items = indexed [1-9] table with recipe items + output = string with item name and quantity + } + Example query for default:gold_ingot will return table: + { + 1={type = "cooking", width = 3, output = "default:gold_ingot", + items = {1 = "default:gold_lump"}}, + 2={type = "normal", width = 1, output = "default:gold_ingot 9", + items = {1 = "default:goldblock"}} + } minetest.handle_node_drops(pos, drops, digger) ^ drops: list of itemstrings ^ Handles drops from nodes after digging: Default action is to put them into |