Skip to content

Commit

Permalink
Enable shadows by default in devtest (minetest#12157)
Browse files Browse the repository at this point in the history
* Move all shadow control to util_commands
* Shadows are now controlled with /set_shadow

Co-authored-by: sfan5 <[email protected]>
  • Loading branch information
x2048 and sfan5 committed Apr 7, 2022
1 parent 21f17e8 commit 1348d9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 0 additions & 8 deletions games/devtest/mods/experimental/lighting.lua

This file was deleted.

14 changes: 14 additions & 0 deletions games/devtest/mods/util_commands/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

0 comments on commit 1348d9a

Please sign in to comment.