
local d = 10
local function fix_light(pos)
    pos = vector.offset(pos, -d, -d, -d)
    minetest.fix_light(pos, vector.offset(pos, d*2, d*2, d*2))
end

local t = 0
minetest.register_globalstep(function(dtime)
    if t > 0 then t = t - dtime; return
    else t = t + 8 end

    for i, player in ipairs(minetest.get_connected_players()) do
        minetest.after(math.random() * 7.5, fix_light, player:get_pos())
    end
end)
