raspberry.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. local S = farming.intllib
  2. -- raspberries
  3. minetest.register_craftitem("farming:raspberries", {
  4. description = S("Raspberries"),
  5. inventory_image = "farming_raspberries.png",
  6. groups = {seed = 2, food_raspberries = 1, food_raspberry = 1,
  7. food_berry = 1, flammable = 2},
  8. on_place = function(itemstack, placer, pointed_thing)
  9. return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1")
  10. end,
  11. on_use = minetest.item_eat(1)
  12. })
  13. -- raspberry smoothie
  14. minetest.register_craftitem("farming:smoothie_raspberry", {
  15. description = S("Raspberry Smoothie"),
  16. inventory_image = "farming_raspberry_smoothie.png",
  17. on_use = minetest.item_eat(2, "vessels:drinking_glass"),
  18. groups = {vessel = 1, drink = 1}
  19. })
  20. minetest.register_craft({
  21. output = "farming:smoothie_raspberry",
  22. recipe = {
  23. {"default:snow"},
  24. {"group:food_raspberries"},
  25. {"vessels:drinking_glass"}
  26. }
  27. })
  28. -- raspberries definition
  29. local def = {
  30. drawtype = "plantlike",
  31. tiles = {"farming_raspberry_1.png"},
  32. paramtype = "light",
  33. sunlight_propagates = true,
  34. walkable = false,
  35. buildable_to = true,
  36. drop = "",
  37. selection_box = farming.select,
  38. groups = {
  39. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  40. not_in_creative_inventory = 1, growing = 1
  41. },
  42. sounds = default.node_sound_leaves_defaults()
  43. }
  44. -- stage 1
  45. minetest.register_node("farming:raspberry_1", table.copy(def))
  46. -- stage 2
  47. def.tiles = {"farming_raspberry_2.png"}
  48. minetest.register_node("farming:raspberry_2", table.copy(def))
  49. -- stage 3
  50. def.tiles = {"farming_raspberry_3.png"}
  51. minetest.register_node("farming:raspberry_3", table.copy(def))
  52. -- stage 4 (final)
  53. def.tiles = {"farming_raspberry_4.png"}
  54. def.groups.growing = nil
  55. def.drop = {
  56. items = {
  57. {items = {"farming:raspberries 2"}, rarity = 1},
  58. {items = {"farming:raspberries"}, rarity = 2},
  59. {items = {"farming:raspberries"}, rarity = 3}
  60. }
  61. }
  62. minetest.register_node("farming:raspberry_4", table.copy(def))
  63. -- add to registered_plants
  64. farming.registered_plants["farming:raspberries"] = {
  65. crop = "farming:raspberry",
  66. seed = "farming:raspberries",
  67. minlight = farming.min_light,
  68. maxlight = farming.max_light,
  69. steps = 4
  70. }