Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --generate a flat sandstone map (needs singlenode)
- --material to use:
- c_mat = minetest.get_content_id("default:sandstone")
- ----
- local genfunction = function (minp,maxp,blockseed)
- local vm, edgemin, edgemax = minetest.get_mapgen_object("voxelmanip")
- local data = vm:get_data()
- local area = VoxelArea:new{MinEdge=edgemin, MaxEdge=emax}
- if minp.x > 0 then return end
- for x = minp.x, maxp.x, 1 do
- for z = minp.z, maxp.z, 1 do
- for y = minp.y, maxp.y, 1 do
- if y < 1 then
- local pos = area:index(x,y,z)
- data[pos] = c_mat
- end
- end
- end
- end
- vm:set_data(data)
- vm:calc_lighting()
- vm:write_to_map(data)
- end
- minetest.register_on_generated(genfunction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement