tomato.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 definition
  17. local def = {
  18. drawtype = "plantlike",
  19. tiles = {"farming_tomato_1.png"},
  20. paramtype = "light",
  21. sunlight_propagates = true,
  22. walkable = false,
  23. buildable_to = true,
  24. drop = "",
  25. selection_box = farming.select,
  26. groups = {
  27. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  28. not_in_creative_inventory = 1, growing = 1
  29. },
  30. sounds = default.node_sound_leaves_defaults()
  31. }
  32. -- stage 1
  33. minetest.register_node("farming:tomato_1", table.copy(def))
  34. -- stage2
  35. def.tiles = {"farming_tomato_2.png"}
  36. minetest.register_node("farming:tomato_2", table.copy(def))
  37. -- stage 3
  38. def.tiles = {"farming_tomato_3.png"}
  39. minetest.register_node("farming:tomato_3", table.copy(def))
  40. -- stage 4
  41. def.tiles = {"farming_tomato_4.png"}
  42. minetest.register_node("farming:tomato_4", table.copy(def))
  43. -- stage 5
  44. def.tiles = {"farming_tomato_5.png"}
  45. minetest.register_node("farming:tomato_5", table.copy(def))
  46. -- stage 6
  47. def.tiles = {"farming_tomato_6.png"}
  48. minetest.register_node("farming:tomato_6", table.copy(def))
  49. -- stage 7
  50. def.tiles = {"farming_tomato_7.png"}
  51. def.drop = {
  52. items = {
  53. {items = {"farming:tomato"}, rarity = 1},
  54. {items = {"farming:tomato"}, rarity = 3}
  55. }
  56. }
  57. minetest.register_node("farming:tomato_7", table.copy(def))
  58. -- stage 8 (final)
  59. def.tiles = {"farming_tomato_8.png"}
  60. def.groups.growing = nil
  61. def.drop = {
  62. items = {
  63. {items = {"farming:tomato 3"}, rarity = 1},
  64. {items = {"farming:tomato 2"}, rarity = 2},
  65. {items = {"farming:tomato 1"}, rarity = 3}
  66. }
  67. }
  68. minetest.register_node("farming:tomato_8", table.copy(def))
  69. -- add to registered_plants
  70. farming.registered_plants["farming:tomato"] = {
  71. crop = "farming:tomato",
  72. seed = "farming:tomato",
  73. minlight = 13,
  74. maxlight = 15,
  75. steps = 8
  76. }