
local vm_data = {}

local c_stone = minetest.get_content_id("artifact:stone")

minetest.register_on_generated(function(vm, minp, maxp)
    local min, max = vm:get_emerged_area()
    local va = VoxelArea(min, max)
    
    vm:get_data(vm_data)
    
    if max.y < 0 then
        for i in va:iterp(minp, maxp) do
            vm_data[i] = c_stone
        end
    end
    
    vm:set_data(vm_data)
    minetest.generate_decorations(vm)
    vm:calc_lighting()
end)
