added error checking for unknown items

This commit is contained in:
TenPlus1 2016-10-30 21:41:22 +00:00
parent c251298bfe
commit d7a86161fe

@ -384,6 +384,12 @@ local lucky_block = function(pos, digger)
item = item .. all_colours[math.random(#all_colours)]
end
if not minetest.registered_nodes[item]
and not minetest.registered_craftitems[item]
and not minetest.registered_tools[item] then
item = "default:coal_lump"
end
local obj = minetest.add_item(pos, item)
if obj then
@ -494,6 +500,11 @@ local lucky_block = function(pos, digger)
})
end
if not minetest.registered_nodes[nod] then
print (nod)
nod = "default:goldblock"
end
minetest.after(2.0, function()
if exp then