From d7a86161fe3f261f3d6c08f96dee2d9a099b9598 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 30 Oct 2016 21:41:22 +0000 Subject: [PATCH] added error checking for unknown items --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index d973868..416dea1 100644 --- a/init.lua +++ b/init.lua @@ -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