slab.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. -- Node will be called <modname>slab_<subname>
  2. function stairsplus.register_slab(modname, subname, recipeitem, groups, images, description, drop, sounds, sunlight)
  3. groups.slab = 1
  4. --
  5. -- nodes
  6. --
  7. minetest.register_node(":".. modname .. ":slab_" .. subname, {
  8. description = description,
  9. drawtype = "nodebox",
  10. tiles = images,
  11. paramtype = "light",
  12. is_ground_content = false,
  13. sunlight_propagates = sunlight,
  14. groups = groups,
  15. drop = modname .. ":slab_" .. drop,
  16. node_box = {
  17. type = "fixed",
  18. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  19. },
  20. sounds = sounds,
  21. })
  22. minetest.register_node(":stairs:slab_" .. subname, {
  23. description = description,
  24. drawtype = "nodebox",
  25. tiles = images,
  26. paramtype = "light",
  27. is_ground_content = false,
  28. sunlight_propagates = sunlight,
  29. groups = groups,
  30. drop = ":stairs:slab_" .. drop,
  31. node_box = {
  32. type = "fixed",
  33. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  34. },
  35. sounds = sounds,
  36. })
  37. minetest.register_node(":".. modname .. ":slab_" .. subname .. "_inverted", {
  38. description = description,
  39. drawtype = "nodebox",
  40. tiles = images,
  41. paramtype = "light",
  42. is_ground_content = false,
  43. sunlight_propagates = sunlight,
  44. groups = groups,
  45. drop = modname .. ":slab_" .. drop .. "_inverted",
  46. node_box = {
  47. type = "fixed",
  48. fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
  49. },
  50. sounds = sounds,
  51. })
  52. --
  53. -- crafting
  54. --
  55. minetest.register_craft({
  56. output = modname .. ":slab_" .. subname .. " 6",
  57. recipe = {
  58. {recipeitem, recipeitem, recipeitem},
  59. },
  60. })
  61. minetest.register_craft({
  62. output = modname .. ":slab_" .. subname .. "_inverted 1",
  63. recipe = {
  64. {modname .. ":slab_" .. subname},
  65. },
  66. })
  67. minetest.register_craft({
  68. output = modname .. ":slab_" .. subname .. " 1",
  69. recipe = {
  70. {modname .. ":slab_" .. subname .. "_inverted"},
  71. },
  72. })
  73. minetest.register_craft({
  74. output = recipeitem,
  75. recipe = {
  76. {modname .. ":slab_" .. subname},
  77. {modname .. ":slab_" .. subname},
  78. },
  79. })
  80. minetest.register_craft({
  81. output = recipeitem,
  82. recipe = {
  83. {modname .. ":slab_" .. subname .. "_inverted"},
  84. {modname .. ":slab_" .. subname .. "_inverted"},
  85. },
  86. })
  87. minetest.register_craft({
  88. output = recipeitem,
  89. recipe = {
  90. {modname .. ":slab_" .. subname},
  91. {modname .. ":slab_" .. subname},
  92. },
  93. })
  94. --
  95. -- cooking
  96. --
  97. minetest.register_craft({
  98. type = "cooking",
  99. output = ":stairs:slab_stone",
  100. recipe = ":stairs:slab_cobble",
  101. })
  102. minetest.register_craft({
  103. type = "cooking",
  104. output = modname .. ":slab_stone_inverted",
  105. recipe = modname .. ":slab_cobble_inverted",
  106. })
  107. end