chili.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. local S = farming.intllib
  2. -- chili pepper
  3. minetest.register_craftitem("farming:chili_pepper", {
  4. description = S("Chili Pepper"),
  5. inventory_image = "farming_chili_pepper.png",
  6. groups = {seed = 2, food_chili_pepper = 1, flammable = 4},
  7. on_place = function(itemstack, placer, pointed_thing)
  8. return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1")
  9. end,
  10. on_use = minetest.item_eat(2)
  11. })
  12. -- bowl of chili
  13. minetest.register_craftitem("farming:chili_bowl", {
  14. description = S("Bowl of Chili"),
  15. inventory_image = "farming_chili_bowl.png",
  16. on_use = minetest.item_eat(8, "farming:bowl")
  17. })
  18. minetest.register_craft({
  19. output = "farming:chili_bowl",
  20. recipe = {
  21. {"group:food_chili_pepper", "group:food_rice", "group:food_tomato"},
  22. {"group:food_beans", "group:food_bowl", ""}
  23. }
  24. })
  25. -- chili can be used for red dye
  26. minetest.register_craft({
  27. output = "dye:red",
  28. recipe = {{"farming:chili_pepper"}}
  29. })
  30. -- chili definition
  31. local def = {
  32. drawtype = "plantlike",
  33. tiles = {"farming_chili_1.png"},
  34. paramtype = "light",
  35. sunlight_propagates = true,
  36. walkable = false,
  37. buildable_to = true,
  38. drop = "",
  39. selection_box = farming.select,
  40. groups = {
  41. snappy = 3, flammable = 4, plant = 1, attached_node = 1,
  42. not_in_creative_inventory = 1, growing = 1
  43. },
  44. sounds = default.node_sound_leaves_defaults()
  45. }
  46. -- stage 1
  47. minetest.register_node("farming:chili_1", table.copy(def))
  48. -- stage 2
  49. def.tiles = {"farming_chili_2.png"}
  50. minetest.register_node("farming:chili_2", table.copy(def))
  51. -- stage 3
  52. def.tiles = {"farming_chili_3.png"}
  53. minetest.register_node("farming:chili_3", table.copy(def))
  54. -- stage 4
  55. def.tiles = {"farming_chili_4.png"}
  56. minetest.register_node("farming:chili_4", table.copy(def))
  57. -- stage 5
  58. def.tiles = {"farming_chili_5.png"}
  59. minetest.register_node("farming:chili_5", table.copy(def))
  60. -- stage 6
  61. def.tiles = {"farming_chili_6.png"}
  62. minetest.register_node("farming:chili_6", table.copy(def))
  63. -- stage 7
  64. def.tiles = {"farming_chili_7.png"}
  65. minetest.register_node("farming:chili_7", table.copy(def))
  66. -- stage 8 (final)
  67. def.tiles = {"farming_chili_8.png"}
  68. def.groups.growing = nil
  69. def.drop = {
  70. items = {
  71. {items = {"farming:chili_pepper 3"}, rarity = 1},
  72. {items = {"farming:chili_pepper 2"}, rarity = 2}
  73. }
  74. }
  75. minetest.register_node("farming:chili_8", table.copy(def))
  76. -- add to registered_plants
  77. farming.registered_plants["farming:chili_pepper"] = {
  78. crop = "farming:chili",
  79. seed = "farming:chili_pepper",
  80. minlight = farming.min_light,
  81. maxlight = farming.max_light,
  82. steps = 8
  83. }