nodecore-cd2025/mods/nc_api/mapgen_shared.lua
2019-02-23 22:48:39 -05:00

24 lines
752 B
Lua

-- LUALOCALS < ---------------------------------------------------------
local VoxelArea, ipairs, minetest, nodecore
= VoxelArea, ipairs, minetest, nodecore
-- LUALOCALS > ---------------------------------------------------------
nodecore.register_mapgen_shared,
nodecore.registered_mapgen_shared
= nodecore.mkreg()
minetest.register_on_generated(function(minp, maxp)
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local data = vm:get_data()
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
for _, v in ipairs(nodecore.registered_mapgen_shared) do
v(minp, maxp, area, data, vm, emin, emax)
end
vm:set_data(data)
vm:set_lighting({day = 0, night = 0})
vm:calc_lighting()
vm:write_to_map()
end)