aboutsummaryrefslogtreecommitdiff
path: root/games/devtest
diff options
context:
space:
mode:
authorx2048 <codeforsmile@gmail.com>2022-04-07 21:55:19 +0200
committerGitHub <noreply@github.com>2022-04-07 21:55:19 +0200
commit1348d9aaf834faa613bf3efe3a9d8fee758e85d0 (patch)
treed075b1e35fd2eabf90f06d2774525f300887208e /games/devtest
parent21f17e871ea3de419f682a8088337ba6ae1d015e (diff)
downloadminetest-1348d9aaf834faa613bf3efe3a9d8fee758e85d0.tar.gz
minetest-1348d9aaf834faa613bf3efe3a9d8fee758e85d0.tar.bz2
minetest-1348d9aaf834faa613bf3efe3a9d8fee758e85d0.zip
Enable shadows by default in devtest (#12157)
* Move all shadow control to util_commands * Shadows are now controlled with /set_shadow Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'games/devtest')
-rw-r--r--games/devtest/mods/experimental/lighting.lua8
-rw-r--r--games/devtest/mods/util_commands/init.lua14
2 files changed, 14 insertions, 8 deletions
diff --git a/games/devtest/mods/experimental/lighting.lua b/games/devtest/mods/experimental/lighting.lua
deleted file mode 100644
index 2b350550f..000000000
--- a/games/devtest/mods/experimental/lighting.lua
+++ /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
diff --git a/games/devtest/mods/util_commands/init.lua b/games/devtest/mods/util_commands/init.lua
index 9be989e67..c37364042 100644
--- a/games/devtest/mods/util_commands/init.lua
+++ b/games/devtest/mods/util_commands/init.lua
@@ -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
+})