pepper.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --[[
  2. Original textures from Crops Plus mod
  3. Copyright (C) 2018 Grizzly Adam
  4. https://forum.minetest.net/viewtopic.php?f=9&t=19488
  5. ]]
  6. local S = farming.intllib
  7. -- peppercorn (seed)
  8. minetest.register_craftitem("farming:peppercorn", {
  9. description = S("Peppercorn"),
  10. inventory_image = "crops_peppercorn.png",
  11. groups = {seed = 1, food_peppercorn = 1, flammable = 3},
  12. on_place = function(itemstack, placer, pointed_thing)
  13. return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1")
  14. end,
  15. })
  16. -- green pepper
  17. minetest.register_craftitem("farming:pepper", {
  18. description = S("Pepper"),
  19. inventory_image = "crops_pepper.png",
  20. on_use = minetest.item_eat(2),
  21. groups = {food_pepper = 1, flammable = 3},
  22. })
  23. minetest.register_craft({
  24. type = "shapeless",
  25. output = "farming:peppercorn",
  26. recipe = {"farming:pepper"}
  27. })
  28. -- ground pepper
  29. minetest.register_node("farming:pepper_ground", {
  30. description = ("Ground Pepper"),
  31. inventory_image = "crops_pepper_ground.png",
  32. wield_image = "crops_pepper_ground.png",
  33. drawtype = "plantlike",
  34. visual_scale = 0.8,
  35. paramtype = "light",
  36. tiles = {"crops_pepper_ground.png"},
  37. groups = {
  38. vessel = 1, food_pepper_ground = 1,
  39. dig_immediate = 3, attached_node = 1
  40. },
  41. sounds = default.node_sound_defaults(),
  42. selection_box = {
  43. type = "fixed",
  44. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  45. },
  46. })
  47. minetest.register_craft( {
  48. output = "farming:pepper_ground",
  49. type = "shapeless",
  50. recipe = {"group:food_peppercorn", "vessels:glass_bottle", "farming:mortar_pestle"},
  51. replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
  52. })
  53. -- crop definition
  54. local crop_def = {
  55. drawtype = "plantlike",
  56. tiles = {"crops_pepper_plant_1.png"},
  57. paramtype = "light",
  58. paramtype2 = "meshoptions",
  59. place_param2 = 1,
  60. sunlight_propagates = true,
  61. waving = 1,
  62. walkable = false,
  63. buildable_to = true,
  64. drop = "",
  65. selection_box = farming.select,
  66. groups = {
  67. snappy = 3, flammable = 3, plant = 1, attached_node = 1,
  68. not_in_creative_inventory = 1, growing = 1
  69. },
  70. sounds = default.node_sound_leaves_defaults()
  71. }
  72. -- stage 1
  73. minetest.register_node("farming:pepper_1", table.copy(crop_def))
  74. -- stage 2
  75. crop_def.tiles = {"crops_pepper_plant_2.png"}
  76. minetest.register_node("farming:pepper_2", table.copy(crop_def))
  77. -- stage 3
  78. crop_def.tiles = {"crops_pepper_plant_3.png"}
  79. minetest.register_node("farming:pepper_3", table.copy(crop_def))
  80. -- stage 4
  81. crop_def.tiles = {"crops_pepper_plant_4.png"}
  82. minetest.register_node("farming:pepper_4", table.copy(crop_def))
  83. -- stage 5
  84. crop_def.tiles = {"crops_pepper_plant_5.png"}
  85. crop_def.groups.growing = 0
  86. crop_def.drop = {
  87. max_items = 2, items = {
  88. {items = {"farming:pepper 2"}, rarity = 1},
  89. {items = {"farming:pepper"}, rarity = 2},
  90. {items = {"farming:pepper"}, rarity = 3},
  91. }
  92. }
  93. minetest.register_node("farming:pepper_5", table.copy(crop_def))
  94. -- add to registered_plants
  95. farming.registered_plants["farming:pepper"] = {
  96. crop = "farming:pepper",
  97. seed = "farming:peppercorn",
  98. minlight = 13,
  99. maxlight = 15,
  100. steps = 5
  101. }