]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Enable shadows by default in devtest (#12157)
authorx2048 <codeforsmile@gmail.com>
Thu, 7 Apr 2022 19:55:19 +0000 (21:55 +0200)
committerGitHub <noreply@github.com>
Thu, 7 Apr 2022 19:55:19 +0000 (21:55 +0200)
* Move all shadow control to util_commands
* Shadows are now controlled with /set_shadow

Co-authored-by: sfan5 <sfan5@live.de>
games/devtest/mods/experimental/lighting.lua [deleted file]
games/devtest/mods/util_commands/init.lua

diff --git a/games/devtest/mods/experimental/lighting.lua b/games/devtest/mods/experimental/lighting.lua
deleted file mode 100644 (file)
index 2b35055..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-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
index 9be989e67d50a859204219331cf87070f987b712..c37364042f8cc7b2607cfb12e4c55f3379ac7f27 100644 (file)
@@ -293,3 +293,17 @@ minetest.register_chatcommand("dump_item", {
                return true, str
        end,
 })
+
+-- shadow control
+minetest.register_on_joinplayer(function (player)
+       player:set_lighting({shadows={intensity = 0.33}})
+end)
+
+core.register_chatcommand("set_shadow", {
+    params = "<shadow_intensity>",
+    description = "Set shadow parameters of current player.",
+    func = function(player_name, param)
+        local shadow_intensity = tonumber(param)
+        minetest.get_player_by_name(player_name):set_lighting({shadows = { intensity = shadow_intensity} })
+    end
+})