Merge pull request #6 from bell07/pr_smart_inventory_funrnace

added optional support for smart_inventory recipes database
master
Casimir 2017-06-04 21:10:34 +02:00 committed by GitHub
commit 2e1c842edd
2 changed files with 19 additions and 0 deletions

View File

@ -1 +1,2 @@
default
smart_inventory?

View File

@ -306,3 +306,21 @@ minetest.register_craft({
{'group:stone', 'group:stone', 'group:stone'},
}
})
if minetest.global_exists("smart_inventory") and smart_inventory.crecipes.add_recipes_from_list then
-- add grinder recipes to smart inventory database
local crecipes = smart_inventory.crecipes
local cache = smart_inventory.cache
local function fill_citem_recipes()
local recipelist = {}
for _, e in ipairs(crushingfurnace_receipes) do
table.insert(recipelist, {
output = e[2],
items = {e[1]},
type = "grinding"
})
end
crecipes.add_recipes_from_list(recipelist)
end
cache.register_on_cache_filled(fill_citem_recipes)
end