init.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. -- Global farming namespace
  2. farming = {}
  3. farming.path = minetest.get_modpath("farming")
  4. -- Load files
  5. dofile(farming.path .. "/api.lua")
  6. dofile(farming.path .. "/nodes.lua")
  7. dofile(farming.path .. "/hoes.lua")
  8. -- WHEAT
  9. farming.register_plant("farming:wheat", {
  10. description = "Wheat Seed",
  11. paramtype2 = "meshoptions",
  12. inventory_image = "farming_wheat_seed.png",
  13. steps = 8,
  14. minlight = 13,
  15. maxlight = default.LIGHT_MAX,
  16. fertility = {"grassland"},
  17. groups = {food_wheat = 1, flammable = 4},
  18. place_param2 = 3,
  19. })
  20. minetest.register_craftitem("farming:flour", {
  21. description = "Flour",
  22. inventory_image = "farming_flour.png",
  23. groups = {food_flour = 1, flammable = 1},
  24. })
  25. minetest.register_craftitem("farming:bread", {
  26. description = "Bread",
  27. inventory_image = "farming_bread.png",
  28. on_use = minetest.item_eat(5),
  29. groups = {food_bread = 1, flammable = 2},
  30. })
  31. minetest.register_craft({
  32. type = "shapeless",
  33. output = "farming:flour",
  34. recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
  35. })
  36. minetest.register_craft({
  37. type = "cooking",
  38. cooktime = 15,
  39. output = "farming:bread",
  40. recipe = "farming:flour"
  41. })
  42. -- Cotton
  43. farming.register_plant("farming:cotton", {
  44. description = "Cotton Seed",
  45. inventory_image = "farming_cotton_seed.png",
  46. steps = 8,
  47. minlight = 13,
  48. maxlight = default.LIGHT_MAX,
  49. fertility = {"grassland", "desert"},
  50. groups = {flammable = 4},
  51. })
  52. minetest.register_craftitem("farming:string", {
  53. description = "String",
  54. inventory_image = "farming_string.png",
  55. groups = {flammable = 2},
  56. })
  57. minetest.register_craft({
  58. output = "wool:white",
  59. recipe = {
  60. {"farming:cotton", "farming:cotton"},
  61. {"farming:cotton", "farming:cotton"},
  62. }
  63. })
  64. minetest.register_craft({
  65. output = "farming:string 2",
  66. recipe = {
  67. {"farming:cotton"},
  68. {"farming:cotton"},
  69. }
  70. })
  71. -- Straw
  72. minetest.register_craft({
  73. output = "farming:straw 3",
  74. recipe = {
  75. {"farming:wheat", "farming:wheat", "farming:wheat"},
  76. {"farming:wheat", "farming:wheat", "farming:wheat"},
  77. {"farming:wheat", "farming:wheat", "farming:wheat"},
  78. }
  79. })
  80. minetest.register_craft({
  81. output = "farming:wheat 3",
  82. recipe = {
  83. {"farming:straw"},
  84. }
  85. })
  86. -- Fuels
  87. minetest.register_craft({
  88. type = "fuel",
  89. recipe = "farming:straw",
  90. burntime = 3,
  91. })
  92. minetest.register_craft({
  93. type = "fuel",
  94. recipe = "farming:wheat",
  95. burntime = 1,
  96. })
  97. minetest.register_craft({
  98. type = "fuel",
  99. recipe = "farming:cotton",
  100. burntime = 1,
  101. })
  102. minetest.register_craft({
  103. type = "fuel",
  104. recipe = "farming:string",
  105. burntime = 1,
  106. })
  107. minetest.register_craft({
  108. type = "fuel",
  109. recipe = "farming:hoe_wood",
  110. burntime = 5,
  111. })