panel.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. -- Node will be called <modname>panel_<subname>
  2. function stairsplus.register_panel(modname, subname, recipeitem, groups, images, description, drop, sounds, sunlight)
  3. --
  4. -- nodes
  5. --
  6. minetest.register_node(modname .. ":panel_" .. subname .. "_bottom", {
  7. description = description,
  8. drawtype = "nodebox",
  9. tiles = images,
  10. paramtype = "light",
  11. paramtype2 = "facedir",
  12. is_ground_content = false,
  13. sunlight_propagates = sunlight,
  14. groups = groups,
  15. drop = modname .. ":panel_" .. drop .. "_bottom",
  16. node_box = {
  17. type = "fixed",
  18. fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
  19. },
  20. sounds = sounds,
  21. })
  22. minetest.register_node(modname .. ":panel_" .. subname .. "_top", {
  23. description = description,
  24. drawtype = "nodebox",
  25. tiles = images,
  26. paramtype = "light",
  27. paramtype2 = "facedir",
  28. is_ground_content = false,
  29. sunlight_propagates = sunlight,
  30. groups = groups,
  31. drop = modname .. ":panel_" .. drop .. "_top",
  32. node_box = {
  33. type = "fixed",
  34. fixed = {-0.5, 0, 0, 0.5, 0.5, 0.5},
  35. },
  36. sounds = sounds,
  37. })
  38. minetest.register_node(modname .. ":panel_" .. subname .. "_vertical", {
  39. description = description,
  40. drawtype = "nodebox",
  41. tiles = images,
  42. paramtype = "light",
  43. paramtype2 = "facedir",
  44. is_ground_content = false,
  45. sunlight_propagates = sunlight,
  46. groups = groups,
  47. drop = modname .. ":panel_" .. drop .. "_vertical",
  48. node_box = {
  49. type = "fixed",
  50. fixed = {-0.5, -0.5, 0, 0, 0.5, 0.5},
  51. },
  52. sounds = sounds,
  53. })
  54. --
  55. -- crafting
  56. --
  57. minetest.register_craft({
  58. output = modname .. ":panel_" .. subname .. "_bottom 8",
  59. recipe = {
  60. {recipeitem, recipeitem},
  61. },
  62. })
  63. minetest.register_craft({
  64. output = modname .. ":panel_" .. subname .. "_vertical 8",
  65. recipe = {
  66. {recipeitem},
  67. {recipeitem},
  68. },
  69. })
  70. minetest.register_craft({
  71. output = recipeitem,
  72. recipe = {
  73. {modname .. ":panel_" .. subname .. "_bottom", modname .. ":panel_" .. subname .. "_bottom"},
  74. {modname .. ":panel_" .. subname .. "_bottom", modname .. ":panel_" .. subname .. "_bottom"},
  75. },
  76. })
  77. minetest.register_craft({
  78. output = recipeitem,
  79. recipe = {
  80. {modname .. ":panel_" .. subname .. "_top", modname .. ":panel_" .. subname .. "_top"},
  81. {modname .. ":panel_" .. subname .. "_top", modname .. ":panel_" .. subname .. "_top"},
  82. },
  83. })
  84. minetest.register_craft({
  85. output = recipeitem,
  86. recipe = {
  87. {modname .. ":panel_" .. subname .. "_vertical", modname .. ":panel_" .. subname .. "_vertical"},
  88. {modname .. ":panel_" .. subname .. "_vertical", modname .. ":panel_" .. subname .. "_vertical"},
  89. },
  90. })
  91. minetest.register_craft({
  92. output = modname .. ":panel_" .. subname .. "_top 1",
  93. recipe = {
  94. {modname .. ":panel_" .. subname .. "_bottom"},
  95. },
  96. })
  97. minetest.register_craft({
  98. output = modname .. ":panel_" .. subname .. "_bottom 1",
  99. recipe = {
  100. {modname .. ":panel_" .. subname .. "_top"},
  101. },
  102. })
  103. minetest.register_craft({
  104. output = modname .. ":panel_" .. subname .. "_vertical 2",
  105. recipe = {
  106. {modname .. ":panel_" .. subname .. "_bottom"},
  107. {modname .. ":panel_" .. subname .. "_bottom"},
  108. },
  109. })
  110. minetest.register_craft({
  111. output = modname .. ":panel_" .. subname .. "_bottom 2",
  112. recipe = {
  113. {modname .. ":panel_" .. subname .. "_vertical", modname .. ":panel_" .. subname .. "_vertical"},
  114. },
  115. })
  116. --
  117. -- cooking
  118. --
  119. minetest.register_craft({
  120. type = "cooking",
  121. output = modname .. ":panel_stone_bottom",
  122. recipe = modname .. ":panel_cobble_bottom",
  123. })
  124. minetest.register_craft({
  125. type = "cooking",
  126. output = modname .. ":panel_stone_top",
  127. recipe = modname .. ":panel_cobble_top",
  128. })
  129. minetest.register_craft({
  130. type = "cooking",
  131. output = modname .. ":panel_stone_vertical",
  132. recipe = modname .. ":panel_cobble_vertical",
  133. })
  134. end