Change API to use lighting table instead

This commit is contained in:
Till Affeldt
2023-03-24 22:22:44 +01:00
parent a71489327a
commit 113ede8523
5 changed files with 76 additions and 42 deletions

View File

@ -38,7 +38,8 @@ minetest.override_chatcommand("shadow_intensity", {
intensity = new_intensity
for _,player in pairs(minetest.get_connected_players()) do
lighting_monoids.shadows:add_change(player, new_intensity, "enable_shadows:base_value")
local lighting = { shadows = { intensity = new_intensity } }
lighting_monoid:add_change(player, lighting, "enable_shadows:base_value")
end
end
})

View File

@ -4,9 +4,8 @@ if weather ~= nil and weather.on_update ~= nil then
if overrides == nil then
return
end
if overrides.shadows and overrides.shadows.intensity then
local intensity = overrides.shadows.intensity
lighting_monoids.shadows:add_change(player, intensity, "weather:cloud_shadows")
if overrides.shadows then
lighting_monoid:add_change(player, { shadows = overrides.shadows }, "weather:cloud_shadows")
end
overrides.lighting = nil
return overrides