49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
local props = minetest.registered_items[ItemStack(item):get_name()]._sorcery
if props and props.recipe then
return props.recipe
end
return {}
end
local modofname = function(id)
local item = minetest.registered_nodes[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
return item.mod_origin
end
................................................................................
return false
end
end
local props = minetest.registered_items[name]._sorcery
local module = modofname(name)
return not (excluded
or 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)
or (restrict.mod and module ~= restrict.mod)
or (restrict.group and (minetest.get_item_group(name, restrict.group) == 0))
|
|
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
local props = minetest.registered_items[ItemStack(item):get_name()]._sorcery
if props and props.recipe then
return props.recipe
end
return {}
end
local modofname = function(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
return item.mod_origin
end
................................................................................
return false
end
end
local props = minetest.registered_items[name]._sorcery
local module = modofname(name)
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)
or (restrict.mod and module ~= restrict.mod)
or (restrict.group and (minetest.get_item_group(name, restrict.group) == 0))
|