Make stairplus:register_* functions work without using register_all.

This commit is contained in:
Pierre-Yves Rollo
2015-11-01 17:54:29 +01:00
parent f02a871c30
commit 54a7102291
8 changed files with 57 additions and 38 deletions

View File

@ -102,9 +102,11 @@ function circular_saw:get_output_inv(modname, material, amount, max)
local t = circular_saw.names[i]
local cost = circular_saw.cost_in_microblocks[i]
local balance = math.min(math.floor(amount/cost), max)
pos = pos + 1
list[pos] = modname .. ":" .. t[1] .. "_" .. material .. t[2]
.. " " .. balance
local nodename = modname .. ":" .. t[1] .. "_" .. material .. t[2]
if minetest.registered_nodes[nodename] then
pos = pos + 1
list[pos] = nodename .. " " .. balance
end
end
return list
end