rhubarb.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 crop_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. }
  43. -- stage 1
  44. minetest.register_node("farming:rhubarb_1", table.copy(crop_def))
  45. -- stage2
  46. crop_def.tiles = {"farming_rhubarb_2.png"}
  47. minetest.register_node("farming:rhubarb_2", table.copy(crop_def))
  48. -- stage 3 (final)
  49. crop_def.tiles = {"farming_rhubarb_3.png"}
  50. crop_def.groups.growing = 0
  51. crop_def.drop = {
  52. items = {
  53. {items = {"farming:rhubarb 2"}, rarity = 1},
  54. {items = {"farming:rhubarb"}, rarity = 2},
  55. {items = {"farming:rhubarb"}, rarity = 3},
  56. }
  57. }
  58. minetest.register_node("farming:rhubarb_3", table.copy(crop_def))
  59. -- add to registered_plants
  60. farming.registered_plants["farming:rhubarb"] = {
  61. crop = "farming:rhubarb",
  62. seed = "farming:rhubarb",
  63. minlight = 13,
  64. maxlight = 15,
  65. steps = 3
  66. }