diff options
-rw-r--r-- | builtin/game/item.lua | 6 | ||||
-rw-r--r-- | builtin/game/privileges.lua | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index c42aff5b0..36c2c1a68 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -233,7 +233,8 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2) place_to = {x = under.x, y = under.y, z = under.z} end - if core.is_protected(place_to, placer:get_player_name()) then + if core.is_protected(place_to, placer:get_player_name()) and + not minetest.check_player_privs(placer, "protection_bypass") then core.log("action", placer:get_player_name() .. " tried to place " .. def.name .. " at protected position " @@ -444,7 +445,8 @@ function core.node_dig(pos, node, digger) return end - if core.is_protected(pos, digger:get_player_name()) then + if core.is_protected(pos, digger:get_player_name()) and + not minetest.check_player_privs(digger, "protection_bypass") then core.log("action", digger:get_player_name() .. " tried to dig " .. node.name .. " at protected position " diff --git a/builtin/game/privileges.lua b/builtin/game/privileges.lua index 7e6387c72..bd5ead624 100644 --- a/builtin/game/privileges.lua +++ b/builtin/game/privileges.lua @@ -32,6 +32,7 @@ core.register_privilege("settime", "Can use /time") core.register_privilege("privs", "Can modify privileges") core.register_privilege("basic_privs", "Can modify 'shout' and 'interact' privileges") core.register_privilege("server", "Can do server maintenance stuff") +core.register_privilege("protection_bypass", "Can bypass node protection in the world") core.register_privilege("shout", "Can speak in chat") core.register_privilege("ban", "Can ban and unban players") core.register_privilege("kick", "Can kick players") |