parsley.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. local S = farming.intllib
  2. -- item definition
  3. minetest.register_craftitem("farming:parsley", {
  4. description = S("Parsley"),
  5. inventory_image = "farming_parsley.png",
  6. groups = {seed = 2, food_parsley = 1, flammable = 2},
  7. on_place = function(itemstack, placer, pointed_thing)
  8. return farming.place_seed(itemstack, placer, pointed_thing, "farming:parsley_1")
  9. end
  10. })
  11. -- crop definition
  12. local def = {
  13. drawtype = "plantlike",
  14. tiles = {"farming_parsley_1.png"},
  15. paramtype = "light",
  16. sunlight_propagates = true,
  17. walkable = false,
  18. buildable_to = true,
  19. drop = "",
  20. selection_box = farming.select,
  21. groups = {
  22. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  23. not_in_creative_inventory = 1, growing = 1
  24. },
  25. sounds = default.node_sound_leaves_defaults()
  26. }
  27. -- stage 1
  28. minetest.register_node("farming:parsley_1", table.copy(def))
  29. -- stage 2
  30. def.tiles = {"farming_parsley_2.png"}
  31. minetest.register_node("farming:parsley_2", table.copy(def))
  32. -- stage 3 (final)
  33. def.tiles = {"farming_parsley_3.png"}
  34. def.groups.growing = nil
  35. def.drop = {
  36. items = {
  37. {items = {"farming:parsley 2"}, rarity = 1},
  38. {items = {"farming:parsley"}, rarity = 2},
  39. {items = {"farming:parsley"}, rarity = 3}
  40. }
  41. }
  42. minetest.register_node("farming:parsley_3", table.copy(def))
  43. -- add to registered_plants
  44. farming.registered_plants["farming:parsley"] = {
  45. crop = "farming:parsley",
  46. seed = "farming:parsley",
  47. minlight = 13,
  48. maxlight = 15,
  49. steps = 3
  50. }