add protection check for other mods (areas) when using tool

This commit is contained in:
TenPlus1 2019-04-30 21:35:11 +01:00
commit 2602de4baf

View file

@ -102,6 +102,14 @@ minetest.register_craftitem("protector:tool", {
return return
end end
-- protection check for other mods like Areas
if minetest.is_protected(pos, name) then
minetest.chat_send_player(name,
"Cannot place protector, already protected at " ..
minetest.pos_to_string(pos))
return
end
-- place protector -- place protector
minetest.set_node(pos, {name = nod, param2 = 1}) minetest.set_node(pos, {name = nod, param2 = 1})