end,\r
})\r
\r
+local function get_node_rlight(pos)\r
+ local vecs = { -- neighboring nodes\r
+ {x= 1, y= 0, z= 0},\r
+ {x=-1, y= 0, z= 0},\r
+ {x= 0, y= 1, z= 0},\r
+ {x= 0, y=-1, z= 0},\r
+ {x= 0, y= 0, z= 1},\r
+ {x= 0, y= 0, z=-1},\r
+ }\r
+ local ret = 0\r
+ for _, v in ipairs(vecs) do\r
+ ret = math.max(ret, minetest.get_node_light(vector.add(pos, v)))\r
+ end\r
+ return ret\r
+end\r
+\r
minetest.register_on_punchnode(function(pos, node, puncher)\r
local name = puncher:get_player_name()\r
if worldedit.inspect[name] then\r
local axis, sign = worldedit.player_axis(name)\r
- message = string.format("inspector: %s at %s (param1=%d, param2=%d, light=%d) punched facing the %s axis",\r
- node.name, minetest.pos_to_string(pos), node.param1, node.param2, minetest.get_node_light(pos), axis .. (sign > 0 and "+" or "-"))\r
+ message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis",\r
+ node.name, minetest.pos_to_string(pos), node.param1, node.param2, get_node_rlight(pos), axis .. (sign > 0 and "+" or "-"))\r
worldedit.player_notify(name, message)\r
end\r
end)\r