crafts.lua 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. minetest.register_craft({
  2. output = "morechests:woodchest_public",
  3. recipe = {
  4. {"group:wood_dark", "group:wood_dark", "group:wood_dark"},
  5. {"group:wood_dark", "", "techcrafts:hinge_wood"},
  6. {"group:wood_dark", "group:wood_dark", "group:wood_dark"},
  7. }
  8. })
  9. minetest.register_craft({
  10. output = "morechests:woodchest_locked",
  11. recipe = {
  12. {"group:wood_dark", "group:wood_dark", "group:wood_dark"},
  13. {"group:wood_dark", "default:padlock", "techcrafts:hinge_wood"},
  14. {"group:wood_dark", "group:wood_dark", "group:wood_dark"},
  15. }
  16. })
  17. minetest.register_craft( {
  18. type = "shapeless",
  19. output = "morechests:woodchest_locked",
  20. recipe = {"morechests:woodchest", "default:padlock"},
  21. })
  22. -- Helper function to reduce code duplication.
  23. local register_metal_chest = function(ingot, chestpublic, chestlocked)
  24. local hinge = "techcrafts:hinge"
  25. minetest.register_craft({
  26. output = chestpublic,
  27. recipe = {
  28. {ingot, ingot, ingot},
  29. {ingot, "morechests:woodchest_public", hinge},
  30. {ingot, ingot, ingot},
  31. }
  32. })
  33. minetest.register_craft({
  34. output = chestpublic,
  35. recipe = {
  36. {ingot, ingot, ingot},
  37. {ingot, "chests:chest_public", hinge},
  38. {ingot, ingot, ingot},
  39. }
  40. })
  41. minetest.register_craft({
  42. output = chestlocked,
  43. recipe = {
  44. {ingot, ingot, ingot},
  45. {ingot, "morechests:woodchest_locked", hinge},
  46. {ingot, ingot, ingot},
  47. }
  48. })
  49. minetest.register_craft({
  50. output = chestlocked,
  51. recipe = {
  52. {ingot, ingot, ingot},
  53. {ingot, "chests:chest_locked", hinge},
  54. {ingot, ingot, ingot},
  55. }
  56. })
  57. minetest.register_craft( {
  58. type = "shapeless",
  59. output = chestlocked,
  60. recipe = {chestpublic, "default:padlock"},
  61. })
  62. end
  63. -- Metalic chests crafts.
  64. register_metal_chest("default:copper_ingot", "morechests:copperchest_public", "morechests:copperchest_locked")
  65. register_metal_chest("cast_iron:ingot", "morechests:ironchest_public", "morechests:ironchest_locked")
  66. register_metal_chest("default:gold_ingot", "morechests:goldchest_public", "morechests:goldchest_locked")
  67. register_metal_chest("moreores:silver_ingot", "morechests:silverchest_public", "morechests:silverchest_locked")
  68. register_metal_chest("moreores:mithril_ingot", "morechests:mithrilchest_public", "morechests:mithrilchest_locked")
  69. register_metal_chest("default:diamond", "morechests:diamondchest_public", "morechests:diamondchest_locked")