corner.lua 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. -- Node will be called <modname>:corner_<subname>
  2. function stairsplus.register_corner(modname, subname, recipeitem, groups, images, description, drop, sounds, sunlight)
  3. --
  4. -- nodes
  5. --
  6. minetest.register_node(":".. modname .. ":corner_" .. subname, {
  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 .. ":corner_" .. drop,
  16. node_box = {
  17. type = "fixed",
  18. fixed = {
  19. {-0.5, -0.5, 0, 0.5, 0.5, 0.5},
  20. {-0.5, -0.5, -0.5, 0, 0.5, 0},
  21. },
  22. },
  23. sounds = sounds,
  24. })
  25. minetest.register_alias(modname .. ":stair_" .. subname .. "_wall", modname .. ":corner_" .. subname)
  26. minetest.register_node(":".. modname .. ":corner_" .. subname .. "_half", {
  27. description = description,
  28. drawtype = "nodebox",
  29. tiles = images,
  30. paramtype = "light",
  31. paramtype2 = "facedir",
  32. is_ground_content = false,
  33. sunlight_propagates = sunlight,
  34. groups = groups,
  35. drop = modname .. ":corner_" .. drop .. "_half",
  36. node_box = {
  37. type = "fixed",
  38. fixed = {
  39. {-0.5, -0.5, 0, 0.5, 0, 0.5},
  40. {-0.5, -0.5, -0.5, 0, 0, 0},
  41. },
  42. },
  43. sounds = sounds,
  44. })
  45. minetest.register_alias(modname .. ":stair_" .. subname .. "_wall_half", modname .. ":corner_" .. subname .. "_half")
  46. minetest.register_node(":".. modname .. ":corner_" .. subname .. "_half_inverted", {
  47. description = description,
  48. drawtype = "nodebox",
  49. tiles = images,
  50. paramtype = "light",
  51. paramtype2 = "facedir",
  52. is_ground_content = false,
  53. sunlight_propagates = sunlight,
  54. groups = groups,
  55. drop = modname .. ":corner_" .. drop .. "_half_inverted",
  56. node_box = {
  57. type = "fixed",
  58. fixed = {
  59. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  60. {-0.5, 0, -0.5, 0, 0.5, 0},
  61. },
  62. },
  63. sounds = sounds,
  64. })
  65. minetest.register_alias(modname .. ":stair_" .. subname .. "_wall_half_inverted", modname .. ":corner_" .. subname .. "_half_inverted")
  66. minetest.register_node(":".. modname .. ":corner_" .. subname .. "_inner", {
  67. description = description,
  68. drawtype = "nodebox",
  69. tiles = images,
  70. paramtype = "light",
  71. paramtype2 = "facedir",
  72. is_ground_content = false,
  73. sunlight_propagates = sunlight,
  74. groups = groups,
  75. drop = modname .. ":corner_" .. drop .. "_inner",
  76. node_box = {
  77. type = "fixed",
  78. fixed = {
  79. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  80. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  81. {-0.5, 0, -0.5, 0, 0.5, 0},
  82. },
  83. },
  84. sounds = sounds,
  85. })
  86. minetest.register_alias(modname .. ":stair_" .. subname .. "_inner", modname .. ":corner_" .. subname .. "_inner")
  87. minetest.register_node(":".. modname .. ":corner_" .. subname .. "_outer", {
  88. description = description,
  89. drawtype = "nodebox",
  90. tiles = images,
  91. paramtype = "light",
  92. paramtype2 = "facedir",
  93. is_ground_content = false,
  94. sunlight_propagates = sunlight,
  95. groups = groups,
  96. drop = modname .. ":corner_" .. drop .. "_outer",
  97. node_box = {
  98. type = "fixed",
  99. fixed = {
  100. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  101. {-0.5, 0, 0, 0, 0.5, 0.5},
  102. },
  103. },
  104. sounds = sounds,
  105. })
  106. minetest.register_alias(modname .. ":stair_" .. subname .. "_outer", modname .. ":corner_" .. subname .. "_outer")
  107. minetest.register_node(":".. modname .. ":corner_" .. subname .. "_inner_inverted", {
  108. description = description,
  109. drawtype = "nodebox",
  110. tiles = images,
  111. paramtype = "light",
  112. paramtype2 = "facedir",
  113. is_ground_content = false,
  114. sunlight_propagates = sunlight,
  115. groups = groups,
  116. drop = modname .. ":corner_" .. drop .. "_inner_inverted",
  117. node_box = {
  118. type = "fixed",
  119. fixed = {
  120. {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
  121. {-0.5, -0.5, 0, 0.5, 0, 0.5},
  122. {-0.5, -0.5, -0.5, 0, 0, 0},
  123. },
  124. },
  125. sounds = sounds,
  126. })
  127. minetest.register_alias(modname .. ":stair_" .. subname .. "_inner_inverted", modname .. ":corner_" .. subname .. "_inner_inverted")
  128. minetest.register_node(":".. modname .. ":corner_" .. subname .. "_outer_inverted", {
  129. description = description,
  130. drawtype = "nodebox",
  131. tiles = images,
  132. paramtype = "light",
  133. paramtype2 = "facedir",
  134. is_ground_content = false,
  135. sunlight_propagates = sunlight,
  136. groups = groups,
  137. drop = modname .. ":corner_" .. drop .. "_outer_inverted",
  138. node_box = {
  139. type = "fixed",
  140. fixed = {
  141. {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
  142. {-0.5, -0.5, 0, 0, 0, 0.5},
  143. },
  144. },
  145. sounds = sounds,
  146. })
  147. minetest.register_alias(modname .. ":stair_" .. subname .. "_outer_inverted", modname .. ":corner_" .. subname .. "_outer_inverted")
  148. --
  149. -- crafting
  150. --
  151. minetest.register_craft({
  152. output = modname .. ":corner_" .. subname .. " 8",
  153. recipe = {
  154. {recipeitem, recipeitem, recipeitem},
  155. {recipeitem, recipeitem, ""},
  156. {recipeitem, "", ""},
  157. },
  158. })
  159. minetest.register_craft({
  160. output = modname .. ":corner_" .. subname .. " 8",
  161. recipe = {
  162. {recipeitem, recipeitem, recipeitem},
  163. {"", recipeitem, recipeitem},
  164. {"", "", recipeitem},
  165. },
  166. })
  167. minetest.register_craft({
  168. output = modname .. ":corner_" .. subname .. "_wall 2",
  169. recipe = {
  170. {modname .. ":corner_" .. subname, modname .. ":corner_" .. subname},
  171. },
  172. })
  173. minetest.register_craft({
  174. output = modname .. ":corner_" .. subname .. "_wall 2",
  175. recipe = {
  176. {modname .. ":corner_" .. subname .. "_inverted", modname .. ":corner_" .. subname .. "_inverted"},
  177. },
  178. })
  179. minetest.register_craft({
  180. output = modname .. ":stair_" .. subname .. " 2",
  181. recipe = {
  182. {modname .. ":corner_" .. subname .. "_wall"},
  183. {modname .. ":corner_" .. subname .. "_wall"},
  184. },
  185. })
  186. minetest.register_craft({
  187. output = modname .. ":corner_" .. subname .. "_inner",
  188. recipe = {
  189. {modname .. ":micro_" .. subname .. "_bottom", modname .. ":stair_" .. subname},
  190. },
  191. })
  192. minetest.register_craft({
  193. output = modname .. ":corner_" .. subname .. "_inner",
  194. recipe = {
  195. {modname .. ":corner_" .. subname .. "_half"},
  196. {modname .. ":slab_" .. subname},
  197. },
  198. })
  199. minetest.register_craft({
  200. output = modname .. ":corner_" .. subname .. "_inner_inverted",
  201. recipe = {
  202. {modname .. ":slab_" .. subname},
  203. {modname .. ":corner_" .. subname .. "_half"},
  204. },
  205. })
  206. minetest.register_craft({
  207. output = modname .. ":corner_" .. subname .. "_outer 1",
  208. recipe = {
  209. {modname .. ":micro_" .. subname .. "_bottom"},
  210. {modname .. ":slab_" .. subname},
  211. },
  212. })
  213. minetest.register_craft({
  214. output = modname .. ":corner_" .. subname .. "_half 1",
  215. recipe = {
  216. {modname .. ":micro_" .. subname .. "_bottom"},
  217. {modname .. ":panel_" .. subname .. "_bottom"},
  218. },
  219. })
  220. minetest.register_craft({
  221. output = modname .. ":corner_" .. subname .. "_inner_inverted",
  222. recipe = {
  223. {modname .. ":corner_" .. subname .. "_inner"},
  224. },
  225. })
  226. minetest.register_craft({
  227. output = modname .. ":corner_" .. subname .. "_outer_inverted",
  228. recipe = {
  229. {modname .. ":corner_" .. subname .. "_outer"},
  230. },
  231. })
  232. minetest.register_craft({
  233. output = modname .. ":corner_" .. subname .. "_inner",
  234. recipe = {
  235. {modname .. ":corner_" .. subname .. "_inner_inverted"},
  236. },
  237. })
  238. minetest.register_craft({
  239. output = modname .. ":corner_" .. subname .. "_outer",
  240. recipe = {
  241. {modname .. ":corner_" .. subname .. "_outer_inverted"},
  242. },
  243. })
  244. minetest.register_craft({
  245. output = modname .. ":corner_" .. subname .. "_half 2",
  246. recipe = {
  247. {modname .. ":corner_" .. subname},
  248. },
  249. })
  250. minetest.register_craft({
  251. output = modname .. ":corner_" .. subname,
  252. recipe = {
  253. {modname .. ":corner_" .. subname .. "_half"},
  254. {modname .. ":corner_" .. subname .. "_half"},
  255. },
  256. })
  257. minetest.register_craft({
  258. output = modname .. ":corner_" .. subname,
  259. recipe = {
  260. {modname .. ":corner_" .. subname .. "_half_inverted"},
  261. {modname .. ":corner_" .. subname .. "_half_inverted"},
  262. },
  263. })
  264. minetest.register_craft({
  265. output = modname .. ":corner_" .. subname .. "_half_inverted",
  266. recipe = {
  267. {modname .. ":corner_" .. subname .. "_half"},
  268. },
  269. })
  270. minetest.register_craft({
  271. output = modname .. ":corner_" .. subname .. "_half",
  272. recipe = {
  273. {modname .. ":corner_" .. subname .. "_half_inverted"},
  274. },
  275. })
  276. minetest.register_craft({
  277. output = recipeitem.." 3",
  278. recipe = {
  279. {modname .. ":corner_" .. subname, modname .. ":corner_" .. subname},
  280. {modname .. ":corner_" .. subname, modname .. ":corner_" .. subname},
  281. },
  282. })
  283. --
  284. -- cooking
  285. --
  286. minetest.register_craft({
  287. type = "cooking",
  288. output = modname .. ":corner_stone",
  289. recipe = modname .. ":corner_cobble",
  290. })
  291. minetest.register_craft({
  292. type = "cooking",
  293. output = modname .. ":corner_stone_half",
  294. recipe = modname .. ":corner_cobble_half",
  295. })
  296. minetest.register_craft({
  297. type = "cooking",
  298. output = modname .. ":corner_stone_half_inverted",
  299. recipe = modname .. ":corner_cobble_half_inverted",
  300. })
  301. minetest.register_craft({
  302. type = "cooking",
  303. output = modname .. ":corner_stone_inner",
  304. recipe = modname .. ":corner_cobble_inner",
  305. })
  306. minetest.register_craft({
  307. type = "cooking",
  308. output = modname .. ":corner_stone_outer",
  309. recipe = modname .. ":corner_cobble_outer",
  310. })
  311. minetest.register_craft({
  312. type = "cooking",
  313. output = modname .. ":corner_stone_inner_inverted",
  314. recipe = modname .. ":corner_cobble_inner_inverted",
  315. })
  316. minetest.register_craft({
  317. type = "cooking",
  318. output = modname .. ":corner_stone_outer_inverted",
  319. recipe = modname .. ":corner_cobble_outer_inverted",
  320. })
  321. end