From 2c96b8bbfc2465be5a6f9471a408f7fad84a7b53 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Thu, 1 Sep 2016 19:56:47 -0700 Subject: [PATCH] [antum_overrides] crafting.lua: Add some logging output to clearing craft methods. Load 'crafting/dye.lua' if 'dye' mod is found. --- mods/antum/overrides/crafting.lua | 37 +++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/mods/antum/overrides/crafting.lua b/mods/antum/overrides/crafting.lua index 60906013..e3406d4f 100644 --- a/mods/antum/overrides/crafting.lua +++ b/mods/antum/overrides/crafting.lua @@ -26,29 +26,48 @@ antum.clearCraftOutput = function(o) + minetest.log('warning', '[' .. antum.overrides.modname .. '] Clearing craft by output: ' .. o) minetest.clear_craft({ - output = o, + output = o }) end antum.clearCraftRecipe = function(r) + local recipe_string = '' + local icount = 0 + for I in pairs(r) do + icount = icount + 1 + end + + for I in pairs(r) do + if I == icount then + recipe_string = recipe_string .. ' ' .. r[I] + elseif I > 1 then + recipe_string = recipe_string .. ' + ' .. r[I] + else + recipe_string = r[I] + end + end + + minetest.log('warning', '[' .. antum.overrides.modname .. '] Clearing craft by recipe: ' .. recipe_string) minetest.clear_craft({ - recipe = r, + recipe = {r} }) end -local craftdir = antum.overrides.modpath .. "/crafting" +local craftdir = antum.overrides.modpath .. '/crafting' local modoverrides = { - "coloredwood", - "craftguide", - "farming", - "helicopter", - } + 'coloredwood', + 'craftguide', + 'dye', + 'farming', + 'helicopter', +} for I in pairs(modoverrides) do local modname = modoverrides[I] if minetest.get_modpath(modname) then - dofile(craftdir .. "/" .. modname .. ".lua") + dofile(craftdir .. '/' .. modname .. '.lua') end end