aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorHybridDog <3192173+HybridDog@users.noreply.github.com>2020-10-06 20:49:46 +0200
committerGitHub <noreply@github.com>2020-10-06 20:49:46 +0200
commit2f4037752b023f87ca1f8859a8dce4f833353967 (patch)
tree5c52b01857c8c46d709d43d1bbc194a3805acded /builtin
parente80fc22dd996e5b0efd8c4f67700c0920e323e46 (diff)
downloadminetest-2f4037752b023f87ca1f8859a8dce4f833353967.tar.gz
minetest-2f4037752b023f87ca1f8859a8dce4f833353967.tar.bz2
minetest-2f4037752b023f87ca1f8859a8dce4f833353967.zip
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/misc.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua
index 341e613c2..96a0a2dda 100644
--- a/builtin/game/misc.lua
+++ b/builtin/game/misc.lua
@@ -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)