summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua17
1 files changed, 5 insertions, 12 deletions
diff --git a/init.lua b/init.lua
index 2b45711..c6f0e64 100644
--- a/init.lua
+++ b/init.lua
@@ -1,20 +1,13 @@
-core.register_on_generated(function(minp, maxp, blockseed)
- local c_node = core.get_content_id("default:stone")
- local miny = minp.y
- if miny > 0 then return end
- local minx, minz, maxx, maxy, maxz = minp.x, minp.z, maxp.x, maxp.y, maxp.z
+core.register_on_generated(function(minp, maxp)
+ if minp.y > 0 then return end
local vm, emin, emax = core.get_mapgen_object("voxelmanip")
- local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
local data = vm:get_data()
- for index in area:iter(minx, miny, minz, maxx, maxy, maxz) do
- data[index] = c_node
+ for index in VoxelArea:new{MinEdge=emin, MaxEdge=emax}:iter(minp.x, minp.y, minp.z, maxp.x, maxp.y, maxp.z) do
+ data[index] = core.get_content_id("default:stone")
end
vm:set_data(data)
vm:set_lighting({day=5, night=5})
vm:calc_lighting()
vm:write_to_map(data)
end)
-
-core.register_on_newplayer(function(player)
- player:setpos({x=0,y=50,z=0})
-end)
+core.register_on_newplayer(function(player) player:setpos({x=0,y=50,z=0}) end)