tomato.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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.intllib
  6. -- tomato
  7. minetest.register_craftitem("farming:tomato", {
  8. description = S("Tomato"),
  9. inventory_image = "farming_tomato.png",
  10. groups = {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},
  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. selection_box = farming.select,
  41. groups = {
  42. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  43. not_in_creative_inventory = 1, growing = 1
  44. },
  45. sounds = default.node_sound_leaves_defaults()
  46. }
  47. -- stage 1
  48. minetest.register_node("farming:tomato_1", table.copy(def))
  49. -- stage2
  50. def.tiles = {"farming_tomato_2.png"}
  51. minetest.register_node("farming:tomato_2", table.copy(def))
  52. -- stage 3
  53. def.tiles = {"farming_tomato_3.png"}
  54. minetest.register_node("farming:tomato_3", table.copy(def))
  55. -- stage 4
  56. def.tiles = {"farming_tomato_4.png"}
  57. minetest.register_node("farming:tomato_4", table.copy(def))
  58. -- stage 5
  59. def.tiles = {"farming_tomato_5.png"}
  60. minetest.register_node("farming:tomato_5", table.copy(def))
  61. -- stage 6
  62. def.tiles = {"farming_tomato_6.png"}
  63. minetest.register_node("farming:tomato_6", table.copy(def))
  64. -- stage 7
  65. def.tiles = {"farming_tomato_7.png"}
  66. def.drop = {
  67. items = {
  68. {items = {"farming:tomato"}, rarity = 1},
  69. {items = {"farming:tomato"}, rarity = 3}
  70. }
  71. }
  72. minetest.register_node("farming:tomato_7", table.copy(def))
  73. -- stage 8 (final)
  74. def.tiles = {"farming_tomato_8.png"}
  75. def.groups.growing = nil
  76. def.drop = {
  77. items = {
  78. {items = {"farming:tomato 3"}, rarity = 1},
  79. {items = {"farming:tomato 2"}, rarity = 2},
  80. {items = {"farming:tomato 1"}, rarity = 3}
  81. }
  82. }
  83. minetest.register_node("farming:tomato_8", table.copy(def))
  84. -- add to registered_plants
  85. farming.registered_plants["farming:tomato"] = {
  86. crop = "farming:tomato",
  87. seed = "farming:tomato",
  88. minlight = farming.min_light,
  89. maxlight = farming.max_light,
  90. steps = 8
  91. }