File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ minetest.register_node("digtron:builder", {
364364 local build_facing = tonumber (meta :get_int (" build_facing" ))
365365 local facing = minetest .get_node (pos ).param2
366366 local buildpos = digtron .find_new_pos (pos , facing )
367+ local protection_bypass = minetest .check_player_privs (player , " protection_bypass" )
367368
368369 if (buildpos [controlling_coordinate ] + meta :get_int (" offset" )) % meta :get_int (" period" ) ~= 0 then
369370 return 0
@@ -388,6 +389,18 @@ minetest.register_node("digtron:builder", {
388389 return built_count
389390 end
390391
392+ -- When extruding beyond the first node, we may be out of area
393+ -- explored by `DigtronLayout`. `can_build_to` is not able to
394+ -- distinguish unknown nodes from unprotected ones.
395+ -- We have to check for protection ourselves.
396+ if extrusion_count > 0 then
397+ if minetest .is_protected (buildpos , player :get_player_name ()) and
398+ not protection_bypass
399+ then
400+ return built_count
401+ end
402+ end
403+
391404 local oldnode = minetest .get_node (buildpos )
392405
393406 if not digtron .config .uses_resources then
You can’t perform that action at this time.
0 commit comments