blockgame/mods/bg_api/util_item.lua

13 lines
311 B
Lua
Raw Normal View History

function blockgame.item_matches (name, options)
return blockgame.any(options, function (option)
if name == option then return true end
if blockgame.starts_with(option, "group:") then
local group = string.sub(option, 7)
return minetest.get_item_group(name, group) > 0
end
return false
end)
end