tomato.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. --[[
  2. Textures edited from:
  3. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1288375-food-plus-mod-more-food-than-you-can-imagine-v2-9)
  4. ]]
  5. local S = farming.translate
  6. -- tomato
  7. minetest.register_craftitem("farming:tomato", {
  8. description = S("Tomato"),
  9. inventory_image = "farming_tomato.png",
  10. groups = {compostability = 45, seed = 2, food_tomato = 1, flammable = 2},
  11. on_place = function(itemstack, placer, pointed_thing)
  12. return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
  13. end,
  14. on_use = minetest.item_eat(4)
  15. })
  16. -- tomato soup
  17. minetest.register_craftitem("farming:tomato_soup", {
  18. description = S("Tomato Soup"),
  19. inventory_image = "farming_tomato_soup.png",
  20. groups = {flammable = 2, compostability = 65},
  21. on_use = minetest.item_eat(8, "farming:bowl")
  22. })
  23. minetest.register_craft({
  24. output = "farming:tomato_soup",
  25. recipe = {
  26. {"group:food_tomato"},
  27. {"group:food_tomato"},
  28. {"group:food_bowl"}
  29. }
  30. })
  31. -- tomato definition
  32. local def = {
  33. drawtype = "plantlike",
  34. tiles = {"farming_tomato_1.png"},
  35. paramtype = "light",
  36. sunlight_propagates = true,
  37. walkable = false,
  38. buildable_to = true,
  39. drop = "",
  40. waving = 1,
  41. selection_box = farming.select,
  42. groups = {
  43. handy = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  44. not_in_creative_inventory = 1, growing = 1
  45. },
  46. sounds = farming.sounds.node_sound_leaves_defaults()
  47. }
  48. -- stage 1
  49. minetest.register_node("farming:tomato_1", table.copy(def))
  50. -- stage2
  51. def.tiles = {"farming_tomato_2.png"}
  52. minetest.register_node("farming:tomato_2", table.copy(def))
  53. -- stage 3
  54. def.tiles = {"farming_tomato_3.png"}
  55. minetest.register_node("farming:tomato_3", table.copy(def))
  56. -- stage 4
  57. def.tiles = {"farming_tomato_4.png"}
  58. minetest.register_node("farming:tomato_4", table.copy(def))
  59. -- stage 5
  60. def.tiles = {"farming_tomato_5.png"}
  61. minetest.register_node("farming:tomato_5", table.copy(def))
  62. -- stage 6
  63. def.tiles = {"farming_tomato_6.png"}
  64. minetest.register_node("farming:tomato_6", table.copy(def))
  65. -- stage 7
  66. def.tiles = {"farming_tomato_7.png"}
  67. def.drop = {
  68. items = {
  69. {items = {"farming:tomato"}, rarity = 1},
  70. {items = {"farming:tomato"}, rarity = 3}
  71. }
  72. }
  73. minetest.register_node("farming:tomato_7", table.copy(def))
  74. -- stage 8 (final)
  75. def.tiles = {"farming_tomato_8.png"}
  76. def.groups.growing = nil
  77. def.selection_box = farming.select_final
  78. def.drop = {
  79. items = {
  80. {items = {"farming:tomato 3"}, rarity = 1},
  81. {items = {"farming:tomato 2"}, rarity = 2},
  82. {items = {"farming:tomato 1"}, rarity = 3}
  83. }
  84. }
  85. minetest.register_node("farming:tomato_8", table.copy(def))
  86. -- add to registered_plants
  87. farming.registered_plants["farming:tomato"] = {
  88. crop = "farming:tomato",
  89. seed = "farming:tomato",
  90. minlight = farming.min_light,
  91. maxlight = farming.max_light,
  92. steps = 8
  93. }
  94. -- mapgen
  95. minetest.register_decoration({
  96. deco_type = "simple",
  97. place_on = {"mcl_core:dirt_with_grass, default:dirt_with_grass"},
  98. sidelen = 16,
  99. noise_params = {
  100. offset = 0,
  101. scale = farming.tomato,
  102. spread = {x = 100, y = 100, z = 100},
  103. seed = 365,
  104. octaves = 3,
  105. persist = 0.6
  106. },
  107. y_min = 5,
  108. y_max = 25,
  109. decoration = "farming:tomato_7"
  110. })