paving.lua 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. minetest.register_alias("castle:pavement", "castle_masonry:pavement_brick")
  2. minetest.register_alias("castle:pavement_brick", "castle_masonry:pavement_brick")
  3. minetest.register_alias("castle:roofslate", "castle_masonry:roofslate")
  4. -- internationalization boilerplate
  5. local MP = minetest.get_modpath(minetest.get_current_modname())
  6. local S, NS = dofile(MP.."/intllib.lua")
  7. minetest.register_node("castle_masonry:pavement_brick", {
  8. description = S("Paving Stone"),
  9. drawtype = "normal",
  10. tiles = {"castle_pavement_brick.png"},
  11. groups = {cracky=2},
  12. paramtype = "light",
  13. sounds = default.node_sound_stone_defaults(),
  14. })
  15. minetest.register_craft({
  16. output = "castle_masonry:pavement_brick 4",
  17. recipe = {
  18. {"default:stone", "default:cobble"},
  19. {"default:cobble", "default:stone"},
  20. }
  21. })
  22. if minetest.get_modpath("moreblocks") then
  23. stairsplus:register_all("castle", "pavement_brick", "castle_masonry:pavement_brick", {
  24. description = S("Pavement Brick"),
  25. tiles = {"castle_pavement_brick.png"},
  26. groups = {cracky=2, not_in_creative_inventory=1},
  27. sounds = default.node_sound_stone_defaults(),
  28. sunlight_propagates = true,
  29. })
  30. elseif minetest.get_modpath("stairs") then
  31. stairs.register_stair_and_slab("pavement_brick", "castle_masonry:pavement_brick",
  32. {cracky=2},
  33. {"castle_pavement_brick.png"},
  34. S("Castle Pavement Stair"),
  35. S("Castle Pavement Slab"),
  36. default.node_sound_stone_defaults()
  37. )
  38. end
  39. minetest.register_node("castle_masonry:roofslate", {
  40. drawtype = "raillike",
  41. description = S("Roof Slates"),
  42. inventory_image = "castle_slate.png",
  43. paramtype = "light",
  44. walkable = false,
  45. tiles = {'castle_slate.png'},
  46. climbable = true,
  47. selection_box = {
  48. type = "fixed",
  49. fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
  50. },
  51. groups = {cracky=3,attached_node=1},
  52. sounds = default.node_sound_glass_defaults(),
  53. })
  54. local mod_building_blocks = minetest.get_modpath("building_blocks")
  55. local mod_streets = minetest.get_modpath("streets") or minetest.get_modpath("asphalt")
  56. if mod_building_blocks then
  57. minetest.register_craft({
  58. output = "castle_masonry:roofslate 4",
  59. recipe = {
  60. { "building_blocks:Tar" , "default:gravel" },
  61. { "default:gravel", "building_blocks:Tar" }
  62. }
  63. })
  64. minetest.register_craft( {
  65. output = "castle_masonry:roofslate 4",
  66. recipe = {
  67. { "default:gravel", "building_blocks:Tar" },
  68. { "building_blocks:Tar" , "default:gravel" }
  69. }
  70. })
  71. end
  72. if mod_streets then
  73. minetest.register_craft( {
  74. output = "castle_masonry:roofslate 4",
  75. recipe = {
  76. { "streets:asphalt" , "default:gravel" },
  77. { "default:gravel", "streets:asphalt" }
  78. }
  79. })
  80. minetest.register_craft( {
  81. output = "castle_masonry:roofslate 4",
  82. recipe = {
  83. { "default:gravel", "streets:asphalt" },
  84. { "streets:asphalt" , "default:gravel" }
  85. }
  86. })
  87. end
  88. if not (mod_building_blocks or mod_streets) then
  89. minetest.register_craft({
  90. type = "cooking",
  91. output = "castle_masonry:roofslate",
  92. recipe = "default:gravel",
  93. })
  94. end