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>
This commit is contained in:
x2048 2022-04-07 21:55:19 +02:00 committed by GitHub
parent 21f17e871e
commit 1348d9aaf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

@ -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
})

@ -293,3 +293,17 @@ minetest.register_chatcommand("dump_item", {
return true, str return true, str
end, 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
})