crops.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. -- PEPPERMINT
  2. -- Peppermint Leaf
  3. minetest.register_craftitem("christmas_holiday_pack:peppermint", {
  4. description = "Peppermint Leaf",
  5. inventory_image = "christmas_holiday_pack_peppermint_leaf.png",
  6. groups = {food_peppermint = 1, flammable = 2},
  7. on_use = minetest.item_eat(3),
  8. })
  9. -- Peppermint Seeds
  10. minetest.register_node("christmas_holiday_pack:peppermint_seeds", {
  11. description = "Peppermint Seeds",
  12. tiles = {"christmas_holiday_pack_peppermint_seeds.png"},
  13. inventory_image = "christmas_holiday_pack_peppermint_seeds.png",
  14. wield_image = "christmas_holiday_pack_peppermint_seeds.png",
  15. drawtype = "signlike",
  16. groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4},
  17. paramtype = "light",
  18. paramtype2 = "wallmounted",
  19. walkable = false,
  20. sunlight_propagates = true,
  21. selection_box = farming.select,
  22. on_place = function(itemstack, placer, pointed_thing)
  23. return farming.place_seed(itemstack, placer, pointed_thing, "christmas_holiday_pack:peppermint_0")
  24. end,
  25. })
  26. -- Peppermint Definition
  27. local crop_def = {
  28. drawtype = "plantlike",
  29. tiles = {"christmas_holiday_pack_peppermint_stage_0.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 0
  43. minetest.register_node("christmas_holiday_pack:peppermint_0", table.copy(crop_def))
  44. -- Stage 1
  45. crop_def.tiles = {"christmas_holiday_pack_peppermint_stage_1.png"}
  46. minetest.register_node("christmas_holiday_pack:peppermint_1", table.copy(crop_def))
  47. -- Stage 2
  48. crop_def.tiles = {"christmas_holiday_pack_peppermint_stage_2.png"}
  49. crop_def.drop = {
  50. items = {
  51. {items = {"christmas_holiday_pack:peppermint"}, rarity = 2},
  52. }
  53. }
  54. minetest.register_node("christmas_holiday_pack:peppermint_2", table.copy(crop_def))
  55. -- Stage 3
  56. crop_def.tiles = {"christmas_holiday_pack_peppermint_stage_3.png"}
  57. crop_def.groups.growing = 0
  58. crop_def.drop = {
  59. items = {
  60. {items = {"christmas_holiday_pack:peppermint"}, rarity = 1},
  61. {items = {"christmas_holiday_pack:peppermint"}, rarity = 1},
  62. {items = {"christmas_holiday_pack:peppermint"}, rarity = 2},
  63. {items = {"christmas_holiday_pack:peppermint_seeds"}, rarity = 1},
  64. {items = {"christmas_holiday_pack:peppermint_seeds"}, rarity = 2},
  65. }
  66. }
  67. minetest.register_node("christmas_holiday_pack:peppermint_3", table.copy(crop_def))
  68. -- Add to Registered Plants
  69. farming.registered_plants["christmas_holiday_pack:peppermint"] = {
  70. crop = "christmas_holiday_pack:peppermint",
  71. seed = "christmas_holiday_pack:peppermint_seeds",
  72. minlight = 13,
  73. maxlight = 15,
  74. steps = 4,
  75. }
  76. -- GINGER
  77. -- Ginger Root
  78. minetest.register_craftitem("christmas_holiday_pack:ginger", {
  79. description = "Ginger Root",
  80. inventory_image = "christmas_holiday_pack_ginger_root.png",
  81. groups = {food_ginger = 1, flammable = 2},
  82. on_use = minetest.item_eat(3),
  83. on_place = function(itemstack, placer, pointed_thing)
  84. return farming.place_seed(itemstack, placer, pointed_thing, "christmas_holiday_pack:ginger_0")
  85. end,
  86. })
  87. -- Ginger Definition
  88. local crop_def = {
  89. drawtype = "plantlike",
  90. tiles = {"christmas_holiday_pack_ginger_stage_0.png"},
  91. paramtype = "light",
  92. sunlight_propagates = true,
  93. walkable = false,
  94. buildable_to = true,
  95. drop = "",
  96. selection_box = farming.select,
  97. groups = {
  98. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  99. not_in_creative_inventory = 1, growing = 1
  100. },
  101. sounds = default.node_sound_leaves_defaults()
  102. }
  103. -- Stage 0
  104. minetest.register_node("christmas_holiday_pack:ginger_0", table.copy(crop_def))
  105. -- Stage 1
  106. crop_def.tiles = {"christmas_holiday_pack_ginger_stage_1.png"}
  107. minetest.register_node("christmas_holiday_pack:ginger_1", table.copy(crop_def))
  108. -- Stage 2
  109. crop_def.tiles = {"christmas_holiday_pack_ginger_stage_2.png"}
  110. crop_def.drop = {
  111. items = {
  112. {items = {"christmas_holiday_pack:ginger"}, rarity = 2},
  113. }
  114. }
  115. minetest.register_node("christmas_holiday_pack:ginger_2", table.copy(crop_def))
  116. -- Stage 3
  117. crop_def.tiles = {"christmas_holiday_pack_ginger_stage_3.png"}
  118. crop_def.groups.growing = 0
  119. crop_def.drop = {
  120. items = {
  121. {items = {"christmas_holiday_pack:ginger"}, rarity = 1},
  122. {items = {"christmas_holiday_pack:ginger"}, rarity = 1},
  123. {items = {"christmas_holiday_pack:ginger"}, rarity = 2},
  124. }
  125. }
  126. minetest.register_node("christmas_holiday_pack:ginger_3", table.copy(crop_def))
  127. -- Add to Registered Plants
  128. farming.registered_plants["christmas_holiday_pack:ginger"] = {
  129. crop = "christmas_holiday_pack:ginger",
  130. seed = "christmas_holiday_pack:ginger",
  131. minlight = 13,
  132. maxlight = 15,
  133. steps = 4,
  134. }