minetest.get_meta(pos):set_string("owner", placer:get_player_name())
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
- if oldmetadata.inventory.pick then
+ if oldmetadata.inventory.pick and oldmetadata.fields.formspec then
local stack = oldmetadata.inventory.pick[1]
if not stack:is_empty() then
minetest.add_item(pos, stack)
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
- if oldmetadata.inventory.pick then
+ if oldmetadata.inventory.pick and oldmetadata.fields.formspec then
local stack = oldmetadata.inventory.pick[1]
if not stack:is_empty() then
minetest.add_item(pos, stack)