Add minetest.get_artificial_light and minetest.get_natural_light (#5680)

Add more detailed light detection functions, a function to get the artificial light (torches) and a function to get the sunlight as seen by the player (you can specify timeofday).

Co-authored-by: rubenwardy <rw@rubenwardy.com>
This commit is contained in:
HybridDog 2020-10-06 20:49:46 +02:00 committed by Nils Dagsson Moskopp
parent 9bac2c659e
commit e5e8fba742
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,12 @@ function core.setting_get_pos(name)
end
-- See l_env.cpp for the other functions
function core.get_artificial_light(param1)
return math.floor(param1 / 16)
end
-- To be overriden by protection mods
function core.is_protected(pos, name)