From 0f25fa7af655b98fa401176a523f269c843d1943 Mon Sep 17 00:00:00 2001 From: x2048 Date: Sat, 26 Mar 2022 16:58:26 +0100 Subject: Add API to control shadow intensity from the game/mod (#11944) * Also Disable shadows when sun/moon is hidden. Fixes #11972. --- games/devtest/mods/experimental/lighting.lua | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 games/devtest/mods/experimental/lighting.lua (limited to 'games/devtest/mods/experimental/lighting.lua') diff --git a/games/devtest/mods/experimental/lighting.lua b/games/devtest/mods/experimental/lighting.lua new file mode 100644 index 000000000..2b350550f --- /dev/null +++ b/games/devtest/mods/experimental/lighting.lua @@ -0,0 +1,8 @@ +core.register_chatcommand("set_lighting", { + params = "shadow_intensity", + description = "Set lighting parameters.", + func = function(player_name, param) + local shadow_intensity = tonumber(param) + minetest.get_player_by_name(player_name):set_lighting({shadows = { intensity = shadow_intensity} }) + end +}) \ No newline at end of file -- cgit v1.2.3