remove protector field when dug

This commit is contained in:
TenPlus1 2018-10-24 13:59:56 +01:00
commit a2e803d522
2 changed files with 15 additions and 0 deletions

View file

@ -430,6 +430,13 @@ minetest.register_node("protector:protect", {
end,
on_blast = function() end,
after_destruct = function(pos, oldnode)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
end
end,
})
minetest.register_craft({
@ -514,6 +521,13 @@ minetest.register_node("protector:protect2", {
end,
on_blast = function() end,
after_destruct = function(pos, oldnode)
local objects = minetest.get_objects_inside_radius(pos, 0.5)
for _, v in ipairs(objects) do
v:remove()
end
end,
})
-- recipes to switch between protectors