init.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. if not minetest.global_exists("nethermapgen") then nethermapgen = {} end
  2. nethermapgen.modpath = minetest.get_modpath("nethermapgen")
  3. -- These are copied in the mapgen script, they MUST match.
  4. nethermapgen.NETHER_START = -25000
  5. nethermapgen.BRIMSTONE_OCEAN = -30800
  6. nethermapgen.BEDROCK_DEPTH = -30900
  7. dofile(nethermapgen.modpath .. "/override.lua")
  8. dofile(nethermapgen.modpath .. "/oregen.lua")
  9. function nethermapgen.on_generated(minp, maxp, blockseed)
  10. local mapgen = minetest.get_mapgen_object("gennotify")
  11. local data = (mapgen.custom and mapgen.custom["nether:mapgen_info"])
  12. if not data then return end
  13. -- 2024/6/8: this ugly hack is currently the best way I know of to make light
  14. -- correct after chunk generation.
  15. minetest.after(math.random(1, 100) / 50, function()
  16. local emin = vector.add(data.minp, {x=-16, y=-16, z=-16})
  17. local emax = vector.add(data.maxp, {x=16, y=16, z=16})
  18. --minetest.chat_send_all('mapfix')
  19. mapfix.work(emin, emax)
  20. end)
  21. end
  22. minetest.set_gen_notify("custom", nil, {"nether:mapgen_info"})
  23. minetest.register_on_generated(function(...)
  24. nethermapgen.on_generated(...)
  25. end)
  26. -- The mapgen function & voxel manipulator code.
  27. minetest.register_mapgen_script(nethermapgen.modpath .. "/mapgen.lua")