vanilla.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. local S = farming.intllib
  2. -- vanilla
  3. minetest.register_craftitem("farming:vanilla", {
  4. description = S("Vanilla"),
  5. inventory_image = "farming_vanilla.png",
  6. groups = {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. selection_box = farming.select,
  22. groups = {
  23. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  24. not_in_creative_inventory = 1, growing = 1
  25. },
  26. sounds = default.node_sound_leaves_defaults()
  27. }
  28. -- vanilla extract
  29. minetest.register_node("farming:vanilla_extract", {
  30. description = S("Vanilla Extract"),
  31. drawtype = "plantlike",
  32. tiles = {"farming_vanilla_extract.png"},
  33. inventory_image = "farming_vanilla_extract.png",
  34. wield_image = "farming_vanilla_extract.png",
  35. paramtype = "light",
  36. is_ground_content = false,
  37. walkable = false,
  38. selection_box = {
  39. type = "fixed",
  40. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  41. },
  42. groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
  43. sounds = default.node_sound_glass_defaults(),
  44. })
  45. minetest.register_craft( {
  46. output = "farming:vanilla_extract",
  47. recipe = {
  48. { "group:food_vanilla", "group:food_vanilla", "group:food_vanilla"},
  49. { "group:food_vanilla", "farming:bottle_ethanol", "bucket:bucket_water"},
  50. },
  51. replacements = {
  52. {"bucket:bucket_water", "bucket:bucket_empty"},
  53. }
  54. })
  55. minetest.register_craft({
  56. type = "fuel",
  57. recipe = "farming:vanilla_extract",
  58. burntime = 25,
  59. replacements = {{ "farming:vanilla_extract", "vessels:glass_bottle" }}
  60. })
  61. -- stage 1
  62. minetest.register_node("farming:vanilla_1", table.copy(def))
  63. -- stage 2
  64. def.tiles = {"farming_vanilla_2.png"}
  65. minetest.register_node("farming:vanilla_2", table.copy(def))
  66. -- stage 3
  67. def.tiles = {"farming_vanilla_3.png"}
  68. minetest.register_node("farming:vanilla_3", table.copy(def))
  69. -- stage 4
  70. def.tiles = {"farming_vanilla_4.png"}
  71. minetest.register_node("farming:vanilla_4", table.copy(def))
  72. -- stage 5
  73. def.tiles = {"farming_vanilla_5.png"}
  74. minetest.register_node("farming:vanilla_5", table.copy(def))
  75. -- stage 6
  76. def.tiles = {"farming_vanilla_6.png"}
  77. def.visual_scale = 1.9
  78. minetest.register_node("farming:vanilla_6", table.copy(def))
  79. -- stage 7
  80. def.tiles = {"farming_vanilla_7.png"}
  81. def.drop = {
  82. items = {
  83. {items = {'farming:vanilla'}, rarity = 1},
  84. {items = {'farming:vanilla'}, rarity = 2},
  85. {items = {'farming:vanilla'}, rarity = 3}
  86. }
  87. }
  88. minetest.register_node("farming:vanilla_7", table.copy(def))
  89. -- stage 8 (final)
  90. def.tiles = {"farming_vanilla_8.png"}
  91. def.groups.growing = nil
  92. def.drop = {
  93. items = {
  94. {items = {'farming:vanilla 2'}, rarity = 1},
  95. {items = {'farming:vanilla 2'}, rarity = 2},
  96. {items = {'farming:vanilla 2'}, rarity = 2},
  97. {items = {'farming:vanilla 2'}, rarity = 3}
  98. }
  99. }
  100. minetest.register_node("farming:vanilla_8", table.copy(def))
  101. -- add to registered_plants
  102. farming.registered_plants["farming:vanilla"] = {
  103. crop = "farming:vanilla",
  104. seed = "farming:vanilla",
  105. minlight = farming.min_light,
  106. maxlight = farming.max_light,
  107. steps = 8
  108. }