tomato.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 crop_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(crop_def))
  34. -- stage2
  35. crop_def.tiles = {"farming_tomato_2.png"}
  36. minetest.register_node("farming:tomato_2", table.copy(crop_def))
  37. -- stage 3
  38. crop_def.tiles = {"farming_tomato_3.png"}
  39. minetest.register_node("farming:tomato_3", table.copy(crop_def))
  40. -- stage 4
  41. crop_def.tiles = {"farming_tomato_4.png"}
  42. minetest.register_node("farming:tomato_4", table.copy(crop_def))
  43. -- stage 5
  44. crop_def.tiles = {"farming_tomato_5.png"}
  45. minetest.register_node("farming:tomato_5", table.copy(crop_def))
  46. -- stage 6
  47. crop_def.tiles = {"farming_tomato_6.png"}
  48. minetest.register_node("farming:tomato_6", table.copy(crop_def))
  49. -- stage 7
  50. crop_def.tiles = {"farming_tomato_7.png"}
  51. crop_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(crop_def))
  58. -- stage 8 (final)
  59. crop_def.tiles = {"farming_tomato_8.png"}
  60. crop_def.groups.growing = 0
  61. crop_def.drop = {
  62. items = {
  63. {items = {"farming:tomato 3"}, rarity = 1},
  64. {items = {"farming:tomato 3"}, rarity = 2},
  65. }
  66. }
  67. minetest.register_node("farming:tomato_8", table.copy(crop_def))
  68. -- add to registered_plants
  69. farming.registered_plants["farming:tomato"] = {
  70. crop = "farming:tomato",
  71. seed = "farming:tomato",
  72. minlight = 13,
  73. maxlight = 15,
  74. steps = 8
  75. }