Fix issue with unknown items

This commit is contained in:
Joachim Stolberg 2021-05-18 21:39:20 +02:00
parent d1fb7cfdac
commit eb78b4e217

View File

@ -153,7 +153,7 @@ end
local function exchange_node(pos, item, param2)
local node = minetest.get_node_or_nil(pos)
if node and is_simple_node(node.name) then
if item and item:get_name() ~= "" then
if item and item:get_name() ~= "" and minetest.registered_nodes[item:get_name()] then
minetest.swap_node(pos, {name = item:get_name(), param2 = param2})
else
minetest.remove_node(pos)