Add protection support to doors
authorShadowNinja <noreply@gmail.com>
Wed, 12 Feb 2014 23:05:16 +0000 (18:05 -0500)
committerShadowNinja <noreply@gmail.com>
Wed, 12 Feb 2014 23:26:43 +0000 (18:26 -0500)
mods/doors/init.lua

index 46ab539b748561cc729219c17325e8c4430be8b3..0df84aa57caa37e7ceb40e38f5cae7de354a4d40 100644 (file)
@@ -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}