1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2024-12-25 02:00:39 +01:00

Show light level with //inspect

This commit is contained in:
sfan5 2017-01-03 17:11:38 +01:00
parent 92fe95fab7
commit 78e4ba828e

View File

@ -165,13 +165,9 @@ minetest.register_chatcommand("/inspect", {
minetest.register_on_punchnode(function(pos, node, puncher)
local name = puncher:get_player_name()
if worldedit.inspect[name] then
if minetest.check_player_privs(name, {worldedit=true}) then
local axis, sign = worldedit.player_axis(name)
message = string.format("inspector: %s at %s (param1=%d, param2=%d) punched by %s facing the %s axis",
node.name, minetest.pos_to_string(pos), node.param1, node.param2, name, axis .. (sign > 0 and "+" or "-"))
else
message = "inspector: worldedit privileges required"
end
local axis, sign = worldedit.player_axis(name)
message = string.format("inspector: %s at %s (param1=%d, param2=%d, light=%d) punched facing the %s axis",
node.name, minetest.pos_to_string(pos), node.param1, node.param2, minetest.get_node_light(pos), axis .. (sign > 0 and "+" or "-"))
worldedit.player_notify(name, message)
end
end)