protector tool doesn't replace anything that isnt ground content when placing protector block
This commit is contained in:
parent
52db28ccdd
commit
4e81345b81
10
tool.lua
10
tool.lua
@ -93,6 +93,16 @@ minetest.register_craftitem("protector:tool", {
|
|||||||
nod = "protector:protect2"
|
nod = "protector:protect2"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- do not replace nodes that aren't ground content e.g. chests
|
||||||
|
local nod2 = minetest.get_node(pos)
|
||||||
|
local def2 = minetest.registered_nodes[nod2.name]
|
||||||
|
|
||||||
|
if not def2 or def2.is_ground_content ~= true then
|
||||||
|
minetest.chat_send_player(name,
|
||||||
|
"Cannot place protector, check node 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…
x
Reference in New Issue
Block a user