1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Add minetest.get_craft_recipe()

This commit is contained in:
darkrose 2012-07-12 04:46:10 +10:00 committed by Perttu Ahola
parent 08e1d40d6e
commit 38580fbee7
4 changed files with 160 additions and 2 deletions

View file

@ -829,6 +829,13 @@ minetest.get_craft_result(input) -> output, decremented_input
^ output.item = ItemStack, if unsuccessful: empty ItemStack
^ output.time = number, if unsuccessful: 0
^ decremented_input = like input
minetest.get_craft_recipe(output) -> input
^ output is a node or item type such as 'default:torch'
^ input.method = 'normal' or 'cooking' or 'fuel'
^ input.width = for example 3
^ 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
Defaults for the on_* item definition functions:
(These return the leftover itemstack)