Differences From
Artifact [29827ac7a0]:
12 12 count = b:get_count() - a:get_count();
13 13 }
14 14 end
15 15 end
16 16 end
17 17
18 18 -- it is extremely unfortunate this function needs to exist.
19 --- minetest needs to export its matching capabilities already
19 +-- luanti needs to export its matching capabilities already
20 20 fn.groupmatch = function(identity,item,exact)
21 21 if exact == nil then exact = true end
22 22 local count
23 23 if type(identity) == 'table' then
24 24 count = identity.count
25 25 identity = identity.name
26 26 else
................................................................................
37 37 end
38 38
39 39 if lib.str.beginswith(identity, 'group:') then
40 40 local stack = ItemStack(item)
41 41 local groups = lib.str.explode(string.sub(identity,7), ',')
42 42 for _,g in pairs(groups) do
43 43 local rn,rv = lib.tbl.split(g,'=')
44 - local gv = minetest.get_item_group(stack:get_name(), rn)
44 + local gv = core.get_item_group(stack:get_name(), rn)
45 45 if rv then
46 46 if gv ~= tonumber(rv) then return false, stack end
47 47 else
48 48 if (not gv) or gv == 0 then return false, stack end
49 49 end
50 50 end
51 51