Check protection for most nodes

This commit is contained in:
Wuzzy 2019-02-08 21:59:01 +01:00
parent bcf7125f9d
commit 312b17a958
18 changed files with 389 additions and 26 deletions

View file

@ -153,7 +153,12 @@ end
local make_rightclick_handler = function(state, mode)
local newnodename =
"mcl_comparators:comparator_"..state.."_"..flipmode(mode)
return function (pos, node)
return function (pos, node, clicker)
local protname = clicker:get_player_name()
if minetest.is_protected(pos, protname) then
minetest.record_protection_violation(pos, protname)
return
end
minetest.swap_node(pos, {name = newnodename, param2 = node.param2 })
end
end