Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- minetest.register_on_generated(function(minp, maxp, seed)
- local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
- local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
- local data = vm:get_data()
- for z = minp.z, maxp.z do
- for y = minp.y, maxp.y do
- for x = minp.x, maxp.x do
- local vi = area:index(x, y, z)
- if data[vi] == minetest.get_content_id("air") and math.random(100) == 1 then
- data[vi] = minetest.get_content_id("default:bush_leaves")
- end
- end
- end
- end
- vm:set_data(data)
- vm:set_lighting({day=0, night=0})
- vm:calc_lighting()
- vm:write_to_map(data)
- for z = minp.z, maxp.z do
- for y = minp.y, maxp.y do
- for x = minp.x, maxp.x do
- local vi = area:index(x, y, z)
- if data[vi] == minetest.get_content_id("default:stone") and data[vi+area.ystride] == minetest.get_content_id("air") and math.random(5) == 1 then
- minetest.place_schematic_on_vmanip(vm, { x = x - 4, y = y, z = z - 4}, minetest.get_modpath("default").."/schematics/acacia_tree.mts", "random", nil, true)
- end
- end
- end
- end
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement