init.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. --[[
  2. Minetest Ethereal Mod
  3. Created by ChinChow
  4. Updated by TenPlus1
  5. ]]
  6. -- DO NOT change settings below, use the settings.conf file instead
  7. ethereal = {
  8. version = "20220219",
  9. leaftype = minetest.settings:get('ethereal.leaftype') or 0,
  10. leafwalk = minetest.settings:get_bool('ethereal.leafwalk', false) or false,
  11. cavedirt = minetest.settings:get_bool('ethereal.cavedirt', true) or true,
  12. torchdrop = minetest.settings:get_bool('ethereal.torchdrop', true) or true,
  13. papyruswalk = minetest.settings:get_bool('ethereal.papyruswalk', true) or true,
  14. lilywalk = minetest.settings:get_bool('ethereal.lilywalk', true) or true,
  15. xcraft = minetest.settings:get_bool('ethereal.xcraft', true) or true,
  16. flight = minetest.settings:get_bool('ethereal.flight', true) or true,
  17. glacier = minetest.settings:get('ethereal.glacier') or 1,
  18. bamboo = minetest.settings:get('ethereal.bamboo') or 1,
  19. mesa = minetest.settings:get('ethereal.mesa') or 1,
  20. alpine = minetest.settings:get('ethereal.alpine') or 1,
  21. healing = minetest.settings:get('ethereal.healing') or 1,
  22. snowy = minetest.settings:get('ethereal.snowy') or 1,
  23. frost = minetest.settings:get('ethereal.frost') or 1,
  24. grassy = minetest.settings:get('ethereal.grassy') or 1,
  25. caves = minetest.settings:get('ethereal.caves') or 1,
  26. grayness = minetest.settings:get('ethereal.grayness') or 1,
  27. grassytwo = minetest.settings:get('ethereal.grassytwo') or 1,
  28. prairie = minetest.settings:get('ethereal.prairie') or 1,
  29. jumble = minetest.settings:get('ethereal.jumble') or 1,
  30. junglee = minetest.settings:get('ethereal.junglee') or 1,
  31. desert = minetest.settings:get('ethereal.desert') or 1,
  32. grove = minetest.settings:get('ethereal.grove') or 1,
  33. mushroom = minetest.settings:get('ethereal.mushroom') or 1,
  34. sandstone = minetest.settings:get('ethereal.sandstone') or 1,
  35. quicksand = minetest.settings:get('ethereal.quicksand') or 1,
  36. plains = minetest.settings:get('ethereal.plains') or 1,
  37. savanna = minetest.settings:get('ethereal.savanna') or 1,
  38. fiery = minetest.settings:get('ethereal.fiery') or 1,
  39. sandclay = minetest.settings:get('ethereal.sandclay') or 1,
  40. swamp = minetest.settings:get('ethereal.swamp') or 1,
  41. sealife = minetest.settings:get('ethereal.sealife') or 1,
  42. reefs = minetest.settings:get('ethereal.reefs') or 1,
  43. sakura = minetest.settings:get('ethereal.sakura') or 1,
  44. tundra = minetest.settings:get('ethereal.tundra') or 1,
  45. mediterranean = minetest.settings:get('ethereal.mediterranean') or 1
  46. }
  47. local path = minetest.get_modpath("ethereal")
  48. -- Load new settings if found
  49. local input = io.open(path.."/settings.conf", "r")
  50. if input then
  51. dofile(path .. "/settings.conf")
  52. input:close()
  53. input = nil
  54. end
  55. -- Intllib
  56. local S
  57. if minetest.get_translator then
  58. S = minetest.get_translator("ethereal")
  59. elseif minetest.global_exists("intllib") then
  60. if intllib.make_gettext_pair then
  61. S = intllib.make_gettext_pair()
  62. else
  63. S = intllib.Getter()
  64. end
  65. else
  66. S = function(s) return s end
  67. end
  68. ethereal.intllib = S
  69. -- Falling node function
  70. ethereal.check_falling = minetest.check_for_falling or nodeupdate
  71. -- creative check
  72. local creative_mode_cache = minetest.settings:get_bool("creative_mode")
  73. function ethereal.check_creative(name)
  74. return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
  75. end
  76. dofile(path .. "/plantlife.lua")
  77. dofile(path .. "/mushroom.lua")
  78. dofile(path .. "/onion.lua")
  79. dofile(path .. "/crystal.lua")
  80. dofile(path .. "/water.lua")
  81. dofile(path .. "/dirt.lua")
  82. dofile(path .. "/food.lua")
  83. dofile(path .. "/wood.lua")
  84. dofile(path .. "/leaves.lua")
  85. dofile(path .. "/sapling.lua")
  86. dofile(path .. "/strawberry.lua")
  87. dofile(path .. "/fishing.lua")
  88. dofile(path .. "/extra.lua")
  89. dofile(path .. "/sealife.lua")
  90. dofile(path .. "/fences.lua")
  91. dofile(path .. "/biomes.lua")
  92. dofile(path .. "/ores.lua")
  93. dofile(path .. "/schems.lua")
  94. dofile(path .. "/decor.lua")
  95. dofile(path .. "/compatibility.lua")
  96. dofile(path .. "/stairs.lua")
  97. dofile(path .. "/lucky_block.lua")
  98. if ethereal.flight then
  99. dofile(path .. "/flight.lua")
  100. end
  101. -- Set bonemeal aliases
  102. if minetest.get_modpath("bonemeal") then
  103. minetest.register_alias("ethereal:bone", "bonemeal:bone")
  104. minetest.register_alias("ethereal:bonemeal", "bonemeal:bonemeal")
  105. else -- or return to where it came from
  106. minetest.register_alias("ethereal:bone", "default:dirt")
  107. minetest.register_alias("ethereal:bonemeal", "default:dirt")
  108. end
  109. if minetest.get_modpath("xanadu") then
  110. dofile(path .. "/plantpack.lua")
  111. end
  112. print ("[MOD] Ethereal loaded")