init.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. -- This file supplies poison ivy for the plantlife modpack
  2. -- Last revision: 2013-01-24
  3. -- support for i18n
  4. local S = minetest.get_translator("poisonivy")
  5. local SPAWN_DELAY = 1000
  6. local SPAWN_CHANCE = 200
  7. local GROW_DELAY = 500
  8. local GROW_CHANCE = 30
  9. local poisonivy_seed_diff = 339
  10. local walls_list = {
  11. "default:dirt",
  12. "default:dirt_with_grass",
  13. "default:stone",
  14. "default:cobble",
  15. "default:mossycobble",
  16. "default:brick",
  17. "default:tree",
  18. "default:jungletree",
  19. "default:stone_with_coal",
  20. "default:stone_with_iron"
  21. },
  22. minetest.register_node('poisonivy:seedling', {
  23. description = S("Poison ivy (seedling)"),
  24. drawtype = 'plantlike',
  25. waving = 1,
  26. tiles = { 'poisonivy_seedling.png' },
  27. inventory_image = 'poisonivy_seedling.png',
  28. wield_image = 'poisonivy_seedling.png',
  29. sunlight_propagates = true,
  30. paramtype = 'light',
  31. walkable = false,
  32. groups = { snappy = 3, poisonivy=1, flora_block=1 },
  33. sounds = default.node_sound_leaves_defaults(),
  34. buildable_to = true,
  35. })
  36. minetest.register_node('poisonivy:sproutling', {
  37. description = S("Poison ivy (sproutling)"),
  38. drawtype = 'plantlike',
  39. waving = 1,
  40. tiles = { 'poisonivy_sproutling.png' },
  41. inventory_image = 'poisonivy_sproutling.png',
  42. wield_image = 'poisonivy_sproutling.png',
  43. sunlight_propagates = true,
  44. paramtype = 'light',
  45. walkable = false,
  46. groups = { snappy = 3, poisonivy=1, flora_block=1 },
  47. sounds = default.node_sound_leaves_defaults(),
  48. buildable_to = true,
  49. })
  50. minetest.register_node('poisonivy:climbing', {
  51. description = S("Poison ivy (climbing plant)"),
  52. drawtype = 'signlike',
  53. tiles = { 'poisonivy_climbing.png' },
  54. inventory_image = 'poisonivy_climbing.png',
  55. wield_image = 'poisonivy_climbing.png',
  56. sunlight_propagates = true,
  57. paramtype = 'light',
  58. paramtype2 = 'wallmounted',
  59. walkable = false,
  60. groups = { snappy = 3, poisonivy=1, flora_block=1 },
  61. sounds = default.node_sound_leaves_defaults(),
  62. selection_box = {
  63. type = "wallmounted",
  64. --wall_side = = <default>
  65. },
  66. buildable_to = true,
  67. })
  68. biome_lib:spawn_on_surfaces({
  69. spawn_delay = SPAWN_DELAY,
  70. spawn_plants = {"poisonivy:seedling"},
  71. avoid_radius = 10,
  72. spawn_chance = SPAWN_CHANCE/10,
  73. spawn_surfaces = {"default:dirt_with_grass"},
  74. avoid_nodes = {"group:poisonivy", "group:flower", "group:flora"},
  75. seed_diff = poisonivy_seed_diff,
  76. light_min = 7,
  77. alt_wallnode = "poisonivy:climbing",
  78. verticals_list = walls_list
  79. })
  80. biome_lib:grow_plants({
  81. grow_delay = SPAWN_DELAY,
  82. grow_chance = GROW_CHANCE,
  83. grow_plant = "poisonivy:seedling",
  84. grow_result = "poisonivy:sproutling",
  85. grow_nodes = {"default:dirt_with_grass"}
  86. })
  87. biome_lib:grow_plants({
  88. grow_delay = GROW_DELAY,
  89. grow_chance = GROW_CHANCE*2,
  90. grow_plant = "poisonivy:climbing",
  91. need_wall = true,
  92. grow_vertically = true,
  93. verticals_list = walls_list,
  94. ground_nodes = {"default:dirt_with_grass"}
  95. })
  96. print("[Poison Ivy] Loaded.")