diff --git a/mods/nc_api/util_misc.lua b/mods/nc_api/util_misc.lua index 180174a3..07e4cf2d 100644 --- a/mods/nc_api/util_misc.lua +++ b/mods/nc_api/util_misc.lua @@ -310,6 +310,12 @@ function nodecore.node_spin_custom(...) local qty = #arr return function(pos, node, clicker, itemstack) + if clicker and clicker:is_player() + and minetest.is_protected(pos, clicker:get_player_name()) then + minetest.record_protection_violation(pos, clicker:get_player_name()) + return + end + node = node or minetest.get_node(pos) node.param2 = lut[node.param2] or lut[false] if clicker:is_player() then diff --git a/mods/nc_scaling/api.lua b/mods/nc_scaling/api.lua index 43f0eb11..f8f1a4f0 100644 --- a/mods/nc_scaling/api.lua +++ b/mods/nc_scaling/api.lua @@ -69,8 +69,13 @@ local function tryreplace(pos, newname, rootpos) end function nodecore.scaling_apply(pointed, player) - if pointed.type ~= "node" or (not pointed.above) or (not pointed.under) - or minetest.is_protected(pointed.above, player:get_player_name()) then return end + if pointed.type ~= "node" or (not pointed.above) or (not pointed.under) then return end + + if player and player:is_player() + and minetest.is_protected(pointed.above, player:get_player_name()) then + minetest.record_protection_violation(pointed.above, player:get_player_name()) + return + end local pos = pointed.above if pointed.under.y > pointed.above.y and issolid(pointed.under) then