fix a bunch of bugs. still need to do more work on the station/circular saw distinction

This commit is contained in:
flux
2022-06-17 12:22:47 -07:00
parent 21d4fab1f5
commit 21f36e6c1c
10 changed files with 60 additions and 17 deletions

View File

@ -179,6 +179,11 @@ function api.register_single(node, shape, overrides, meta)
-- register node
local shaped_name = api.format_name(node, shape)
for k, v in pairs(def.groups) do
if type(v) ~= "number" then
error(("%s %s group:%s = %s"):format(node, shape, k, v))
end
end
minetest.register_node(":" .. shaped_name, def)
-- alias old name formats
@ -228,7 +233,9 @@ function api.register_groups(node, groups, overrides, meta)
end
function api.get_shapes(node)
return table_sort_keys(api.shapes_by_node[node])
if api.shapes_by_node[node] then
return table_sort_keys(api.shapes_by_node[node])
end
end
-- warning: don't mutate the return value