init.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. minetest.register_alias("castle:street_light", "castle_lighting:light")
  2. minetest.register_alias("castle:light", "castle_lighting:light")
  3. minetest.register_alias("castle:chandelier", "castle_lighting:chandelier")
  4. minetest.register_alias("castle:chandelier_chain", "castle_lighting:chandelier_chain")
  5. -- internationalization boilerplate
  6. local MP = minetest.get_modpath(minetest.get_current_modname())
  7. local S, NS = dofile(MP.."/intllib.lua")
  8. castle_lighting = {}
  9. dofile(MP.."/brasier.lua")
  10. minetest.register_node("castle_lighting:light",{
  11. drawtype = "glasslike",
  12. description = S("Light Block"),
  13. sunlight_propagates = true,
  14. light_source = 14,
  15. tiles = {"castle_street_light.png"},
  16. groups = {cracky=2},
  17. sounds = default.node_sound_glass_defaults(),
  18. paramtype = "light",
  19. })
  20. minetest.register_craft({
  21. output = "castle_lighting:light",
  22. recipe = {
  23. {"default:stick", "default:glass", "default:stick"},
  24. {"default:glass", "default:torch", "default:glass"},
  25. {"default:stick", "default:glass", "default:stick"},
  26. }
  27. })
  28. minetest.register_node( "castle_lighting:chandelier", {
  29. drawtype = "plantlike",
  30. description = S("Chandelier"),
  31. paramtype = "light",
  32. wield_image = "castle_chandelier_wield.png",
  33. inventory_image = "castle_chandelier_wield.png",
  34. groups = {cracky=2},
  35. sounds = default.node_sound_glass_defaults(),
  36. sunlight_propagates = true,
  37. light_source = 14,
  38. tiles = {
  39. {
  40. name = "castle_chandelier.png",
  41. animation = {
  42. type = "vertical_frames",
  43. aspect_w = 16,
  44. aspect_h = 16,
  45. length = 1.0
  46. },
  47. },
  48. },
  49. selection_box = {
  50. type = "fixed",
  51. fixed = {
  52. {0.35,-0.375,0.35,-0.35,0.5,-0.35},
  53. },
  54. },
  55. })
  56. minetest.register_craft({
  57. output = "castle_lighting:chandelier",
  58. recipe = {
  59. {"", "", ""},
  60. {"", "default:steel_ingot", ""},
  61. {"default:torch","default:torch","default:torch"},
  62. }
  63. })
  64. minetest.register_node( "castle_lighting:chandelier_chain", {
  65. drawtype = "plantlike",
  66. description = S("Chandelier Chain"),
  67. paramtype = "light",
  68. wield_image = "castle_chandelier_chain.png",
  69. inventory_image = "castle_chandelier_chain.png",
  70. groups = {cracky=2},
  71. sounds = default.node_sound_glass_defaults(),
  72. sunlight_propagates = true,
  73. tiles = {"castle_chandelier_chain.png"},
  74. selection_box = {
  75. type = "fixed",
  76. fixed = {
  77. {0.1,-0.5,0.1,-0.1,0.5,-0.1},
  78. },
  79. },
  80. })
  81. minetest.register_craft({
  82. output = "castle_lighting:chandelier_chain 4",
  83. recipe = {
  84. {"", "default:steel_ingot", ""},
  85. {"", "", ""},
  86. {"","default:steel_ingot",""},
  87. }
  88. })