init.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. steps = 8,
  53. minlight = 13,
  54. maxlight = default.LIGHT_MAX,
  55. fertility = {"grassland", "desert"},
  56. groups = {flammable = 4},
  57. flowerpot_drop = "farming:cotton",
  58. 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"},
  59. })
  60. -- alias no longer used -- we have an actual string item that is craftable from cotton
  61. --minetest.register_alias("farming:string", "farming:cotton")
  62. minetest.register_craft({
  63. output = "wool:white",
  64. recipe = {
  65. {"farming:cotton", "farming:cotton"},
  66. {"farming:cotton", "farming:cotton"},
  67. }
  68. })
  69. -- Straw
  70. minetest.register_craft({
  71. output = "farming:straw 3",
  72. recipe = {
  73. {"farming:wheat", "farming:wheat", "farming:wheat"},
  74. {"farming:wheat", "farming:wheat", "farming:wheat"},
  75. {"farming:wheat", "farming:wheat", "farming:wheat"},
  76. }
  77. })
  78. minetest.register_craft({
  79. output = "farming:straw_weathered 4",
  80. recipe = {
  81. {"farming:straw", "farming:straw"},
  82. {"farming:straw", "farming:straw"},
  83. }
  84. })
  85. minetest.register_craft({
  86. output = "farming:wheat 3",
  87. recipe = {
  88. {"farming:straw"},
  89. }
  90. })