2018-07-19 11:48:34 +02:00
|
|
|
mmgen_lvm_example = {}
|
|
|
|
|
|
|
|
function mmgen_lvm_example.generate(current_layer, minp, maxp, offset_minp, offset_maxp)
|
2018-07-17 21:16:37 +02:00
|
|
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
2018-07-17 22:59:58 +02:00
|
|
|
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
|
|
|
|
local vm_data = vm:get_data()
|
|
|
|
if offset_minp.y >= 0 then
|
|
|
|
multi_map.generate_singlenode_chunk(minp, maxp, area, vm_data, multi_map.c_air)
|
|
|
|
vm:set_lighting({day=15, night=0})
|
|
|
|
else
|
|
|
|
multi_map.generate_singlenode_chunk(minp, maxp, area, vm_data, multi_map.c_stone)
|
2018-07-17 21:16:37 +02:00
|
|
|
end
|
2018-07-17 22:59:58 +02:00
|
|
|
vm:set_data(vm_data)
|
|
|
|
vm:calc_lighting(false)
|
|
|
|
vm:write_to_map(false)
|
2018-07-17 21:16:37 +02:00
|
|
|
end
|