init.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. chests = chest or {}
  2. chests.modpath = minetest.get_modpath("chests")
  3. minetest.register_craft({
  4. output = 'chests:chest_public_closed',
  5. recipe = {
  6. {'group:wood_light', 'group:wood_light', 'group:wood_light'},
  7. {'group:wood_light', '', 'group:wood_light'},
  8. {'group:wood_light', 'group:wood_light', 'group:wood_light'},
  9. }
  10. })
  11. minetest.register_craft({
  12. output = 'chests:chest_locked_closed',
  13. recipe = {
  14. {'group:wood_light', 'group:wood_light', 'group:wood_light'},
  15. {'group:wood_light', 'default:padlock', 'group:wood_light'},
  16. {'group:wood_light', 'group:wood_light', 'group:wood_light'},
  17. }
  18. })
  19. minetest.register_craft( {
  20. type = "shapeless",
  21. output = "chests:chest_locked_closed",
  22. recipe = {"chests:chest_public_closed", "default:padlock"},
  23. })
  24. minetest.register_craft({
  25. type = "fuel",
  26. recipe = "chests:chest_public_closed",
  27. burntime = 30,
  28. })
  29. minetest.register_craft({
  30. type = "fuel",
  31. recipe = "chests:chest_locked_closed",
  32. burntime = 30,
  33. })
  34. -- Compatibility.
  35. minetest.register_alias("default:chest", "chests:chest_public_closed")
  36. minetest.register_alias("default:chest_locked", "chests:chest_locked_closed")
  37. minetest.register_alias("chests:chest_public", "chests:chest_public_closed")
  38. minetest.register_alias("chests:chest_locked", "chests:chest_locked_closed")
  39. chest_api.register_chest("chests:chest_public", {
  40. description = "Unlocked Chest",
  41. tiles = { "default_chest_wood.png" },
  42. sounds = default.node_sound_wood_defaults(),
  43. sound_open = "default_chest_open",
  44. sound_close = "default_chest_close",
  45. groups = utility.dig_groups("chest", {
  46. chest = 1,
  47. tubedevice = 1,
  48. tubedevice_receiver = 1,
  49. }),
  50. })
  51. chest_api.register_chest("chests:chest_locked", {
  52. description = "Locked Chest",
  53. tiles = { "default_chest_wood_locked.png" },
  54. sounds = default.node_sound_wood_defaults(),
  55. sound_open = "default_chest_open",
  56. sound_close = "default_chest_close",
  57. groups = utility.dig_groups("chest", {
  58. chest = 1,
  59. tubedevice = 1,
  60. tubedevice_receiver = 1,
  61. }),
  62. protected = true,
  63. })