mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add API to control shadow intensity from the game/mod (#11944)
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
This commit is contained in:
parent
8d55702d13
commit
0f25fa7af6
24 changed files with 375 additions and 169 deletions
|
@ -7,6 +7,7 @@ experimental = {}
|
|||
dofile(minetest.get_modpath("experimental").."/detached.lua")
|
||||
dofile(minetest.get_modpath("experimental").."/items.lua")
|
||||
dofile(minetest.get_modpath("experimental").."/commands.lua")
|
||||
dofile(minetest.get_modpath("experimental").."/lighting.lua")
|
||||
|
||||
function experimental.print_to_everything(msg)
|
||||
minetest.log("action", msg)
|
||||
|
|
8
games/devtest/mods/experimental/lighting.lua
Normal file
8
games/devtest/mods/experimental/lighting.lua
Normal file
|
@ -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
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue