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

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

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