init.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. -- The armor craft registrations are in their own directory in order to break up
  2. -- circular dependency issues.
  3. for k, v in pairs(ARMOR_MATERIALS) do
  4. local padding = "group:leather_padding"
  5. if v == "group:wood" then
  6. padding = "farming:cotton"
  7. elseif minetest.get_item_group(v, "gem") ~= 0 then
  8. padding = "farming:cloth"
  9. end
  10. minetest.register_craft({
  11. output = "3d_armor:helmet_"..k,
  12. recipe = {
  13. {v, v, v},
  14. {v, padding, v},
  15. {padding, "farming:string", padding},
  16. },
  17. })
  18. minetest.register_craft({
  19. output = "3d_armor:chestplate_"..k,
  20. recipe = {
  21. {v, padding, v},
  22. {v, padding, v},
  23. {v, v, v},
  24. },
  25. })
  26. minetest.register_craft({
  27. output = "3d_armor:leggings_"..k,
  28. recipe = {
  29. {v, "farming:string", v},
  30. {v, padding, v},
  31. {v, padding, v},
  32. },
  33. })
  34. minetest.register_craft({
  35. output = "3d_armor:boots_"..k,
  36. recipe = {
  37. {padding, "", padding},
  38. {v, "farming:string", v},
  39. {v, "farming:string", v},
  40. },
  41. })
  42. if not string.find(v, "wood") and not string.find(v, "diamond") and string.find(v, "ingot") then
  43. minetest.register_craft({
  44. type = "cooking",
  45. output = v .. " 5",
  46. recipe = "3d_armor:helmet_"..k,
  47. cooktime = 15,
  48. })
  49. minetest.register_craft({
  50. type = "cooking",
  51. output = v .. " 8",
  52. recipe = "3d_armor:chestplate_"..k,
  53. cooktime = 15,
  54. })
  55. minetest.register_craft({
  56. type = "cooking",
  57. output = v .. " 7",
  58. recipe = "3d_armor:leggings_"..k,
  59. cooktime = 15,
  60. })
  61. minetest.register_craft({
  62. type = "cooking",
  63. output = v .. " 4",
  64. recipe = "3d_armor:boots_"..k,
  65. cooktime = 15,
  66. })
  67. end
  68. -- Wooden armor can be used as fuel.
  69. if string.find(v, "wood") then
  70. minetest.register_craft({
  71. type = "fuel",
  72. recipe = "3d_armor:helmet_" .. k,
  73. burntime = 4,
  74. })
  75. minetest.register_craft({
  76. type = "fuel",
  77. recipe = "3d_armor:chestplate_" .. k,
  78. burntime = 4,
  79. })
  80. minetest.register_craft({
  81. type = "fuel",
  82. recipe = "3d_armor:leggings_" .. k,
  83. burntime = 4,
  84. })
  85. minetest.register_craft({
  86. type = "fuel",
  87. recipe = "3d_armor:boots_" .. k,
  88. burntime = 4,
  89. })
  90. end
  91. end