raspberry.lua 2.1 KB

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