init.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. -- Global farming namespace
  2. farming = {}
  3. farming.path = minetest.get_modpath("farming")
  4. farming.select = {
  5. type = "fixed",
  6. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
  7. }
  8. -- Load files
  9. dofile(farming.path .. "/api.lua")
  10. dofile(farming.path .. "/nodes.lua")
  11. dofile(farming.path .. "/hoes.lua")
  12. -- WHEAT
  13. farming.register_plant("farming:wheat", {
  14. description = "Wheat Seed",
  15. paramtype2 = "meshoptions",
  16. inventory_image = "farming_wheat_seed.png",
  17. steps = 8,
  18. minlight = 13,
  19. maxlight = default.LIGHT_MAX,
  20. fertility = {"grassland"},
  21. groups = {flammable = 4},
  22. place_param2 = 3,
  23. flowerpot_drop = "farming:wheat",
  24. flowerpot_insert = {"farming:wheat_1", "farming:wheat_2", "farming:wheat_3", "farming:wheat_4", "farming:wheat_5", "farming:wheat_6", "farming:wheat_7", "farming:wheat_8"},
  25. })
  26. minetest.register_craftitem("farming:flour", {
  27. description = "Flour",
  28. inventory_image = "farming_flour.png",
  29. groups = {flammable = 1, foodrot=1},
  30. })
  31. minetest.register_craftitem("farming:bread", {
  32. description = "Bread",
  33. inventory_image = "farming_bread.png",
  34. on_use = minetest.item_eat(5),
  35. groups = {flammable = 2, foodrot=1},
  36. })
  37. minetest.register_craft({
  38. type = "shapeless",
  39. output = "farming:flour",
  40. recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
  41. })
  42. minetest.register_craft({
  43. type = "cooking",
  44. cooktime = 5,
  45. output = "farming:bread",
  46. recipe = "farming:flour"
  47. })
  48. -- Cotton
  49. farming.register_plant("farming:cotton", {
  50. description = "Cotton Seed",
  51. inventory_image = "farming_cotton_seed.png",
  52. paramtype2 = "degrotate",
  53. steps = 8,
  54. minlight = 13,
  55. maxlight = default.LIGHT_MAX,
  56. fertility = {"grassland", "desert"},
  57. groups = {flammable = 4},
  58. flowerpot_drop = "farming:cotton",
  59. flowerpot_insert = {"farming:cotton_1", "farming:cotton_2", "farming:cotton_3", "farming:cotton_4", "farming:cotton_5", "farming:cotton_6", "farming:cotton_7", "farming:cotton_8"},
  60. })
  61. -- alias no longer used -- we have an actual string item that is craftable from cotton
  62. --minetest.register_alias("farming:string", "farming:cotton")
  63. minetest.register_craft({
  64. output = "wool:white",
  65. recipe = {
  66. {"farming:cloth", "farming:cloth"},
  67. {"farming:cloth", "farming:cloth"},
  68. }
  69. })
  70. -- Straw
  71. minetest.register_craft({
  72. output = "farming:straw 3",
  73. recipe = {
  74. {"farming:wheat", "farming:wheat", "farming:wheat"},
  75. {"farming:wheat", "farming:wheat", "farming:wheat"},
  76. {"farming:wheat", "farming:wheat", "farming:wheat"},
  77. }
  78. })
  79. minetest.register_craft({
  80. output = "farming:straw_weathered 4",
  81. recipe = {
  82. {"farming:straw", "farming:straw"},
  83. {"farming:straw", "farming:straw"},
  84. }
  85. })
  86. minetest.register_craft({
  87. output = "farming:wheat 3",
  88. recipe = {
  89. {"farming:straw"},
  90. }
  91. })
  92. --------------------------------------------------------------------------------
  93. minetest.register_craftitem("farming:cloth", {
  94. description = "Cloth",
  95. inventory_image = "farming_cloth.png",
  96. groups = {flammable = 3, cloth = 1},
  97. })
  98. minetest.register_craft({
  99. output = "farming:cloth",
  100. recipe = {
  101. {"farming:cotton", "farming:string", "farming:cotton"},
  102. },
  103. })
  104. minetest.register_craft({
  105. type = "fuel",
  106. recipe = "farming:cloth",
  107. burntime = 3,
  108. })