vanilla.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. local S = farming.translate
  2. -- vanilla
  3. minetest.register_craftitem("farming:vanilla", {
  4. description = S("Vanilla"),
  5. inventory_image = "farming_vanilla.png",
  6. groups = {compostability = 48, seed = 2, food_vanilla = 1, flammable = 2},
  7. on_place = function(itemstack, placer, pointed_thing)
  8. return farming.place_seed(itemstack, placer, pointed_thing, "farming:vanilla_1")
  9. end,
  10. on_use = minetest.item_eat(1)
  11. })
  12. -- crop definition
  13. local def = {
  14. drawtype = "plantlike",
  15. tiles = {"farming_vanilla_1.png"},
  16. paramtype = "light",
  17. sunlight_propagates = true,
  18. walkable = false,
  19. buildable_to = true,
  20. drop = "",
  21. waving = 1,
  22. selection_box = farming.select,
  23. groups = {
  24. handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  25. not_in_creative_inventory = 1, growing = 1
  26. },
  27. sounds = farming.sounds.node_sound_leaves_defaults()
  28. }
  29. -- vanilla extract
  30. minetest.register_node("farming:vanilla_extract", {
  31. description = S("Vanilla Extract"),
  32. drawtype = "plantlike",
  33. tiles = {"farming_vanilla_extract.png"},
  34. inventory_image = "farming_vanilla_extract.png",
  35. wield_image = "farming_vanilla_extract.png",
  36. paramtype = "light",
  37. is_ground_content = false,
  38. walkable = false,
  39. selection_box = {
  40. type = "fixed",
  41. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  42. },
  43. groups = {vessel = 1, dig_immediate = 3, attached_node = 1, compostability = 35},
  44. sounds = farming.sounds.node_sound_glass_defaults(),
  45. })
  46. minetest.register_craft( {
  47. output = "farming:vanilla_extract",
  48. recipe = {
  49. {"group:food_vanilla", "group:food_vanilla", "group:food_vanilla"},
  50. {"group:food_vanilla", "farming:bottle_ethanol", "group:food_water_glass"},
  51. },
  52. replacements = {
  53. {"group:food_water_glass", "vessels:drinking_glass"}
  54. }
  55. })
  56. minetest.register_craft({
  57. type = "fuel",
  58. recipe = "farming:vanilla_extract",
  59. burntime = 25,
  60. replacements = {{"farming:vanilla_extract", "vessels:glass_bottle"}}
  61. })
  62. -- stage 1
  63. minetest.register_node("farming:vanilla_1", table.copy(def))
  64. -- stage 2
  65. def.tiles = {"farming_vanilla_2.png"}
  66. minetest.register_node("farming:vanilla_2", table.copy(def))
  67. -- stage 3
  68. def.tiles = {"farming_vanilla_3.png"}
  69. minetest.register_node("farming:vanilla_3", table.copy(def))
  70. -- stage 4
  71. def.tiles = {"farming_vanilla_4.png"}
  72. minetest.register_node("farming:vanilla_4", table.copy(def))
  73. -- stage 5
  74. def.tiles = {"farming_vanilla_5.png"}
  75. minetest.register_node("farming:vanilla_5", table.copy(def))
  76. -- stage 6
  77. def.tiles = {"farming_vanilla_6.png"}
  78. def.visual_scale = 1.9
  79. minetest.register_node("farming:vanilla_6", table.copy(def))
  80. -- stage 7
  81. def.tiles = {"farming_vanilla_7.png"}
  82. def.drop = {
  83. items = {
  84. {items = {"farming:vanilla"}, rarity = 1},
  85. {items = {"farming:vanilla"}, rarity = 2},
  86. {items = {"farming:vanilla"}, rarity = 3}
  87. }
  88. }
  89. minetest.register_node("farming:vanilla_7", table.copy(def))
  90. -- stage 8 (final)
  91. def.tiles = {"farming_vanilla_8.png"}
  92. def.groups.growing = nil
  93. def.selection_box = farming.select_final
  94. def.drop = {
  95. items = {
  96. {items = {"farming:vanilla 2"}, rarity = 1},
  97. {items = {"farming:vanilla 2"}, rarity = 2},
  98. {items = {"farming:vanilla 2"}, rarity = 2},
  99. {items = {"farming:vanilla 2"}, rarity = 3}
  100. }
  101. }
  102. minetest.register_node("farming:vanilla_8", table.copy(def))
  103. -- add to registered_plants
  104. farming.registered_plants["farming:vanilla"] = {
  105. crop = "farming:vanilla",
  106. seed = "farming:vanilla",
  107. minlight = farming.min_light,
  108. maxlight = farming.max_light,
  109. steps = 8
  110. }
  111. -- mapgen
  112. minetest.register_decoration({
  113. deco_type = "simple",
  114. place_on = {"mcl_core:dirt_with_grass, default:dirt_with_grass"},
  115. sidelen = 16,
  116. noise_params = {
  117. offset = 0,
  118. scale = farming.vanilla,
  119. spread = {x = 100, y = 100, z = 100},
  120. seed = 476,
  121. octaves = 3,
  122. persist = 0.6
  123. },
  124. y_min = 5,
  125. y_max = 35,
  126. decoration = "farming:vanilla_7"
  127. })