mirror of
https://notabug.org/TenPlus1/lucky_block.git
synced 2024-10-04 07:23:03 +02:00
added error checking for unknown items
This commit is contained in:
parent
c251298bfe
commit
d7a86161fe
11
init.lua
11
init.lua
@ -384,6 +384,12 @@ local lucky_block = function(pos, digger)
|
|||||||
item = item .. all_colours[math.random(#all_colours)]
|
item = item .. all_colours[math.random(#all_colours)]
|
||||||
end
|
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)
|
local obj = minetest.add_item(pos, item)
|
||||||
|
|
||||||
if obj then
|
if obj then
|
||||||
@ -494,6 +500,11 @@ local lucky_block = function(pos, digger)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not minetest.registered_nodes[nod] then
|
||||||
|
print (nod)
|
||||||
|
nod = "default:goldblock"
|
||||||
|
end
|
||||||
|
|
||||||
minetest.after(2.0, function()
|
minetest.after(2.0, function()
|
||||||
|
|
||||||
if exp then
|
if exp then
|
||||||
|
Loading…
Reference in New Issue
Block a user