rhubarb.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. local S = farming.intllib
  2. -- rhubarb
  3. minetest.register_craftitem("farming:rhubarb", {
  4. description = S("Rhubarb"),
  5. inventory_image = "farming_rhubarb.png",
  6. groups = {seed = 2, food_rhubarb = 1, flammable = 2},
  7. on_place = function(itemstack, placer, pointed_thing)
  8. return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1")
  9. end,
  10. on_use = minetest.item_eat(1)
  11. })
  12. -- rhubarb pie
  13. minetest.register_craftitem("farming:rhubarb_pie", {
  14. description = S("Rhubarb Pie"),
  15. inventory_image = "farming_rhubarb_pie.png",
  16. on_use = minetest.item_eat(6)
  17. })
  18. minetest.register_craft({
  19. output = "farming:rhubarb_pie",
  20. recipe = {
  21. {"farming:baking_tray", "group:food_sugar", ""},
  22. {"group:food_rhubarb", "group:food_rhubarb", "group:food_rhubarb"},
  23. {"group:food_wheat", "group:food_wheat", "group:food_wheat"}
  24. },
  25. replacements = {{"group:food_baking_tray", "farming:baking_tray"}}
  26. })
  27. -- rhubarb definition
  28. local def = {
  29. drawtype = "plantlike",
  30. tiles = {"farming_rhubarb_1.png"},
  31. paramtype = "light",
  32. sunlight_propagates = true,
  33. walkable = false,
  34. buildable_to = true,
  35. drop = "",
  36. selection_box = farming.select,
  37. groups = {
  38. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  39. not_in_creative_inventory = 1, growing = 1
  40. },
  41. sounds = default.node_sound_leaves_defaults(),
  42. minlight = 10,
  43. maxlight = 12,
  44. }
  45. -- stage 1
  46. minetest.register_node("farming:rhubarb_1", table.copy(def))
  47. -- stage2
  48. def.tiles = {"farming_rhubarb_2.png"}
  49. minetest.register_node("farming:rhubarb_2", table.copy(def))
  50. -- stage 3 (final)
  51. def.tiles = {"farming_rhubarb_3.png"}
  52. def.groups.growing = nil
  53. def.drop = {
  54. items = {
  55. {items = {"farming:rhubarb 2"}, rarity = 1},
  56. {items = {"farming:rhubarb"}, rarity = 2},
  57. {items = {"farming:rhubarb"}, rarity = 3}
  58. }
  59. }
  60. minetest.register_node("farming:rhubarb_3", table.copy(def))
  61. -- add to registered_plants
  62. farming.registered_plants["farming:rhubarb"] = {
  63. crop = "farming:rhubarb",
  64. seed = "farming:rhubarb",
  65. minlight = 10,
  66. maxlight = 12,
  67. steps = 3
  68. }