Check protection for most nodes
This commit is contained in:
parent
bcf7125f9d
commit
312b17a958
18 changed files with 389 additions and 26 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue