Index: cookbook.lua ================================================================== --- cookbook.lua +++ cookbook.lua @@ -51,11 +51,11 @@ return props.recipe end return {} end local modofname = function(id) - local item = minetest.registered_nodes[id] + local item = minetest.registered_items[id] if item == nil or item.mod_origin == '??' or not item.mod_origin then local sep = string.find(id,':') if sep == nil then return nil end -- uh oh return string.sub(id, 1, sep - 1) end @@ -74,12 +74,12 @@ end local props = minetest.registered_items[name]._sorcery local module = modofname(name) - return not (excluded - or sorcery.lib.tbl.has(constants.blacklist_mods,module) + return not ( + sorcery.lib.tbl.has(constants.blacklist_mods,module) or (props and props.recipe and props.recipe.secret) or (restrict and ( (restrict.pred and restrict.pred { mod = module, item = name, props = props } ~= true) Index: keg.lua ================================================================== --- keg.lua +++ keg.lua @@ -1,7 +1,12 @@ local constants = { keg_volume = sorcery.liquid.constants.glasses_per_bottle * 600 + keg_recipe = { + {'','sorcery:keg',''}; + {'sorcery:screw_steel','group:wood','sorcery:screw_steel'}; + {'sorcery:screw_steel','screwdriver:screwdriver','sorcery:screw_steel'}; + }; } local hitbox = function(yo) return { type = 'fixed'; fixed = { @@ -48,10 +53,15 @@ 'default_wood.png'; 'default_steel_block.png'; }; selection_box = hitbox(keg.ofs or 0); collision_box = keg.cb or hitbox(keg.ofs or 0); + _sorcery = { + recipe = { + canonical = constants.keg_recipe; + }; + }; drop = { -- preserve_metadata will not work without this! max_items = 1; items = { { items = { keg.id } }; @@ -211,15 +221,11 @@ }; } minetest.register_craft { output = "sorcery:keg_stand"; - recipe = { - {'','sorcery:keg',''}; - {'sorcery:screw_steel','group:wood','sorcery:screw_steel'}; - {'sorcery:screw_steel','screwdriver:screwdriver','sorcery:screw_steel'}; - }; + recipe = constants.keg_recipe; replacements = {{'screwdriver:screwdriver', 'screwdriver:screwdriver'}}; } minetest.register_craft { output = "sorcery:keg";