diff options
author | cheapie <no-email-for-you@example.com> | 2016-12-04 17:18:39 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2016-12-04 17:18:39 -0600 |
commit | 98ac141ac0db291d90641d852addc83f4ba1f5c4 (patch) | |
tree | 945d3a3aa7a955f02afb07cb2116ee242a0aabd6 | |
parent | f90001680135a4b6092a309d4227d4a18512e0bc (diff) | |
download | flatperiod-98ac141ac0db291d90641d852addc83f4ba1f5c4.tar flatperiod-98ac141ac0db291d90641d852addc83f4ba1f5c4.tar.gz flatperiod-98ac141ac0db291d90641d852addc83f4ba1f5c4.tar.bz2 flatperiod-98ac141ac0db291d90641d852addc83f4ba1f5c4.tar.xz flatperiod-98ac141ac0db291d90641d852addc83f4ba1f5c4.zip |
Shorten a bit
-rw-r--r-- | init.lua | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -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) |