sorcery  Diff

Differences From Artifact [207e1d6da6]:

To Artifact [3a273fe491]:


    49     49   	local props = minetest.registered_items[ItemStack(item):get_name()]._sorcery
    50     50   	if props and props.recipe then
    51     51   		return props.recipe
    52     52   	end
    53     53   	return {}
    54     54   end
    55     55   local modofname = function(id)
    56         -	local item = minetest.registered_nodes[id]
           56  +	local item = minetest.registered_items[id]
    57     57   	if item == nil or item.mod_origin == '??' or not item.mod_origin then
    58     58   		local sep = string.find(id,':')
    59     59   		if sep == nil then return nil end -- uh oh
    60     60   		return string.sub(id, 1, sep - 1)
    61     61   	end
    62     62   	return item.mod_origin
    63     63   end
................................................................................
    72     72   			return false
    73     73   		end
    74     74   	end
    75     75   
    76     76   	local props = minetest.registered_items[name]._sorcery
    77     77   	local module = modofname(name)
    78     78   
    79         -	return not (excluded
    80         -		or sorcery.lib.tbl.has(constants.blacklist_mods,module)
           79  +	return not (
           80  +		    sorcery.lib.tbl.has(constants.blacklist_mods,module)
    81     81   		or (props and props.recipe and props.recipe.secret)
    82     82   		or (restrict and (
    83     83   			(restrict.pred and restrict.pred {
    84     84   				mod = module, item = name, props = props
    85     85   			} ~= true)
    86     86   		 or (restrict.mod   and module ~= restrict.mod)
    87     87   		 or (restrict.group and (minetest.get_item_group(name, restrict.group) == 0))