add protection check for other mods (areas) when using tool
This commit is contained in:
parent
a2e803d522
commit
2602de4baf
1 changed files with 143 additions and 135 deletions
8
tool.lua
8
tool.lua
|
|
@ -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})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue