From: ShadowNinja Date: Wed, 12 Feb 2014 23:05:16 +0000 (-0500) Subject: Add protection support to doors X-Git-Tag: 0.4.10~47 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3e2781bc008074342a73fc7cb77d900cc83981cb;p=oweals%2Fminetest_game.git Add protection support to doors --- diff --git a/mods/doors/init.lua b/mods/doors/init.lua index 46ab539b..0df84aa5 100644 --- a/mods/doors/init.lua +++ b/mods/doors/init.lua @@ -59,6 +59,12 @@ function doors:register_door(name, def) then return itemstack end + + if minetest.is_protected(pt, placer:get_player_name()) or + minetest.is_protected(pt2, placer:get_player_name()) then + minetest.record_protection_violation(pt, placer:get_player_name()) + return itemstack + end local p2 = minetest.dir_to_facedir(placer:get_look_dir()) local pt3 = {x=pt.x, y=pt.y, z=pt.z}