init.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --------------------------------------------------------------------------------
  2. -- Gem Mapgen Mod for Must Test Survival
  3. -- Author: GoldFireUn
  4. -- License of Source Code: MIT
  5. --------------------------------------------------------------------------------
  6. gem_mapgen = gem_mapgen or {}
  7. gem_mapgen.modpath = minetest.get_modpath("gem_mapgen")
  8. if not gem_mapgen.registered then
  9. local ores = {
  10. {ore="ruby", scar=48, num=3, size=4, ymin=-30000, ymax=-15000},
  11. {ore="ruby", scar=24, num=6, size=4, ymin=-20000, ymax=-18000},
  12. {ore="amethyst", scar=45, num=3, size=4, ymin=-30000, ymax=-5000},
  13. {ore="amethyst", scar=22, num=6, size=4, ymin=-9000, ymax=-6000},
  14. {ore="sapphire", scar=42, num=3, size=4, ymin=-30000, ymax=-18000},
  15. {ore="sapphire", scar=28, num=6, size=4, ymin=-21000, ymax=-18000},
  16. {ore="emerald", scar=40, num=3, size=4, ymin=-30000, ymax=-5000},
  17. {ore="emerald", scar=27, num=6, size=4, ymin=-10000, ymax=-8000},
  18. }
  19. for k, v in ipairs(ores) do
  20. local ore = "gems:" .. v.ore .. "_ore"
  21. local stone = "default:stone"
  22. local scarcity = v.scar * v.scar * v.scar
  23. oregen.register_ore({
  24. ore_type = "scatter",
  25. ore = ore,
  26. wherein = stone,
  27. clust_scarcity = scarcity,
  28. clust_num_ores = v.num,
  29. clust_size = v.size,
  30. y_min = v.ymin,
  31. y_max = v.ymax,
  32. })
  33. end
  34. local c = "gem_mapgen:core"
  35. local f = gem_mapgen.modpath .. "/init.lua"
  36. reload.register_file(c, f, false)
  37. gem_mapgen.registered = true
  38. end