init.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. -------------------------------------------------------------
  2. --Do files
  3. -------------------------------------------------------------
  4. dofile(minetest.get_modpath("earthbuild").."/earth.lua")
  5. dofile(minetest.get_modpath("earthbuild").."/roofing.lua")
  6. dofile(minetest.get_modpath("earthbuild").."/wattle.lua")
  7. dofile(minetest.get_modpath("earthbuild").."/whitewash.lua")
  8. dofile(minetest.get_modpath("earthbuild").."/drystack.lua")
  9. dofile(minetest.get_modpath("earthbuild").."/earthship.lua")
  10. dofile(minetest.get_modpath("earthbuild").."/tools.lua")
  11. dofile(minetest.get_modpath("earthbuild").."/clay_pot.lua")
  12. dofile(minetest.get_modpath("earthbuild").."/bed.lua")
  13. dofile(minetest.get_modpath("earthbuild").."/furnace.lua")
  14. dofile(minetest.get_modpath("earthbuild").."/doors.lua")
  15. dofile(minetest.get_modpath("earthbuild").."/storage.lua")
  16. dofile(minetest.get_modpath("earthbuild").."/weaving.lua")
  17. dofile(minetest.get_modpath("earthbuild").."/hearth.lua")
  18. dofile(minetest.get_modpath("earthbuild").."/farming.lua")
  19. ---------------------------------------------------------------
  20. --MISC STUFF
  21. ----------------------------
  22. -- DEGRADE
  23. --Most of these construction need special care.
  24. --they must be kept dry or they fall to bits.
  25. --Therefore the degradation mechanism simulates how builders cope with that.
  26. --Earthen blocks must be kept away from moisture/soil
  27. -- simulates water, worms etc breaking it back up to dirt
  28. --Therefore they must be kept off the ground/dry/whitewashed
  29. -- A fairly slow process
  30. --Some things are more durable than others...
  31. --Fast. Things that are already dirt like, easily decomposed
  32. minetest.register_abm({
  33. label = "Fast degrade Earthbuild",
  34. nodenames = {
  35. "earthbuild:compacted_dirt",
  36. "earthbuild:strawbale",
  37. "earthbuild:thatch",
  38. "stairs:thatch",
  39. "stairs:slab_thatch",
  40. "earthbuild:turf",
  41. "stairs:stair_turf",
  42. "stairs:slab_turf",
  43. },
  44. neighbors = {
  45. "group:soil",
  46. "group:water",
  47. },
  48. interval = 180,
  49. chance = 250,
  50. catch_up = false,
  51. action = function(pos, node)
  52. --turn back to dirt
  53. minetest.set_node(pos, {name = "default:dirt"})
  54. end
  55. })
  56. --Medium. Harder to degrade, but no special resistance.
  57. minetest.register_abm({
  58. label = "Degrade Earthbuild",
  59. nodenames = {
  60. "earthbuild:cob",
  61. "earthbuild:mud_brick",
  62. "stairs:stair_cob",
  63. "stairs:stair_mud_brick",
  64. "stairs:slab_cob",
  65. "stairs:slab_mud_brick",
  66. },
  67. neighbors = {
  68. "group:soil",
  69. "group:water",
  70. },
  71. interval = 360,
  72. chance = 500,
  73. catch_up = false,
  74. action = function(pos, node)
  75. --turn back to dirt
  76. minetest.set_node(pos, {name = "default:dirt"})
  77. end
  78. })
  79. --Slow. Resistant, or partly protected
  80. minetest.register_abm({
  81. label = "Slow Degrade Earthbuild",
  82. nodenames = {
  83. "earthbuild:rammed_earth",
  84. "stairs:stair_rammed_earth",
  85. "stairs:slab_rammed_earth",
  86. "earthbuild:wattle_and_daub",
  87. "earthbuild:supported_rammed_earth",
  88. "earthbuild:junglewood_supported_rammed_earth",
  89. "earthbuild:pine_wood_supported_rammed_earth",
  90. "earthbuild:acacia_wood_supported_rammed_earth",
  91. "earthbuild:aspen_wood_supported_rammed_earth",
  92. "earthbuild:supported_cob",
  93. "earthbuild:junglewood_supported_cob",
  94. "earthbuild:pine_wood_supported_cob",
  95. "earthbuild:acacia_wood_supported_cob",
  96. "earthbuild:aspen_wood_supported_cob"
  97. },
  98. neighbors = {
  99. "group:soil",
  100. "group:water",
  101. },
  102. interval = 720,
  103. chance = 1000,
  104. catch_up = false,
  105. action = function(pos, node)
  106. if node.name == "earthbuild:wattle_and_daub" then
  107. --daub falls off
  108. minetest.set_node(pos, {name = "earthbuild:wattle"})
  109. else
  110. --turn back to dirt
  111. minetest.set_node(pos, {name = "default:dirt"})
  112. end
  113. end
  114. })