shapes.lua 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. -- Node (shape) definition and registration
  2. local wehavechisels = minetest.get_modpath("mychisel")
  3. --------------
  4. --Bannerstones
  5. --------------
  6. --Node will be called facade:<subname>_bannerstone
  7. function facade.register_bannerstone(modname, subname, recipeitem, desc)
  8. minetest.register_node("facade:" .. subname .. "_bannerstone" , {
  9. description = desc .. " Bannerstone",
  10. drawtype = "nodebox",
  11. tiles = {
  12. "" .. modname.. "_" .. subname .. ".png",
  13. "" .. modname.. "_" .. subname .. ".png",
  14. "" .. modname.. "_" .. subname .. ".png",
  15. "" .. modname.. "_" .. subname .. ".png",
  16. "" .. modname.. "_" .. subname .. ".png",
  17. "" .. modname.. "_" .. subname .. ".png^facade_bannerstone.png"},
  18. paramtype = "light",
  19. paramtype2 = "facedir",
  20. is_ground_content = false,
  21. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  22. sounds = default.node_sound_stone_defaults(),
  23. node_box = {
  24. type = "fixed",
  25. fixed = {
  26. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  27. {-0.5, 0.25, -0.5625, 0.5, 0.375, -0.5},
  28. {-0.5, -0.375, -0.5625, 0.5, -0.25, -0.5},
  29. },
  30. },
  31. selection_box = {
  32. type = "fixed",
  33. fixed = {
  34. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  35. }
  36. },
  37. })
  38. end
  39. --Node will be called facade:<subname>_bannerstone_corner
  40. function facade.register_bannerstone_corner(modname, subname, recipeitem, desc)
  41. minetest.register_node("facade:" .. subname .. "_bannerstone_corner", {
  42. description = desc .. " Bannerstone Corner",
  43. drawtype = "nodebox",
  44. tiles = {
  45. "" .. modname.. "_" .. subname .. ".png",
  46. "" .. modname.. "_" .. subname .. ".png",
  47. "" .. modname.. "_" .. subname .. ".png^facade_bannerstone.png",
  48. "" .. modname.. "_" .. subname .. ".png^facade_bannerstone.png",
  49. "" .. modname.. "_" .. subname .. ".png^facade_bannerstone.png",
  50. "" .. modname.. "_" .. subname .. ".png^facade_bannerstone.png"},
  51. paramtype = "light",
  52. paramtype2 = "facedir",
  53. is_ground_content = false,
  54. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  55. sounds = default.node_sound_stone_defaults(),
  56. node_box = {
  57. type = "fixed",
  58. fixed = {
  59. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  60. {-0.5625, 0.25, -0.5625, 0.5625, 0.375, 0.5625},
  61. {-0.5625, -0.375, -0.5625, 0.5625, -0.25, 0.5625},
  62. },
  63. },
  64. selection_box = {
  65. type = "fixed",
  66. fixed = {
  67. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  68. }
  69. },
  70. })
  71. end
  72. --------------
  73. --Centerstones
  74. --------------
  75. --Node will be called facade:<subname>_centerstone
  76. function facade.register_centerstone(modname, subname, recipeitem, desc)
  77. minetest.register_node("facade:" .. subname .. "_centerstone", {
  78. description = desc .. " Centerstone",
  79. drawtype = "nodebox",
  80. tiles = {"" .. modname.. "_" .. subname .. ".png^facade_centerstone.png"},
  81. paramtype = "light",
  82. is_ground_content = false,
  83. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  84. sounds = default.node_sound_stone_defaults(),
  85. node_box = {
  86. type = "fixed",
  87. fixed = {
  88. {-0.4375, -0.4375, -0.4375, 0.4375, 0.4375, 0.4375},
  89. {-0.5, -0.25, 0.0625, 0.5, 0.25, 0.25},
  90. {-0.5, -0.25, -0.25, 0.5, 0.25, -0.0625},
  91. {-0.25, -0.25, -0.5, -0.0625, 0.25, 0.5},
  92. {0.0625, -0.25, -0.5, 0.25, 0.25, 0.5},
  93. {-0.5, 0.0625, -0.25, 0.5, 0.25, 0.25},
  94. {-0.5, -0.25, -0.25, 0.5, -0.0625, 0.25},
  95. {-0.25, -0.25, -0.5, 0.25, -0.0625, 0.5},
  96. {-0.25, 0.0625, -0.5, 0.25, 0.25, 0.5},
  97. {-0.25, -0.5, -0.25, 0.25, 0.5, -0.0625},
  98. {-0.25, -0.5, 0.0625, 0.25, 0.5, 0.25},
  99. {0.0625, -0.5, -0.1875, 0.25, 0.5, 0.1875},
  100. {-0.25, -0.5, -0.1875, -0.0625, 0.5, 0.1875},
  101. {-0.5, 0.3125, 0.3125, 0.5, 0.5, 0.5},
  102. {-0.5, 0.3125, -0.5, 0.5, 0.5, -0.3125},
  103. {0.3125, 0.3125, -0.5, 0.5, 0.5, 0.5},
  104. {-0.5, 0.3125, -0.5, -0.3125, 0.5, 0.5},
  105. {-0.5, -0.5, -0.5, -0.3125, -0.3125, 0.5},
  106. {0.3125, -0.5, -0.5, 0.5, -0.3125, 0.5},
  107. {-0.5, -0.5, -0.5, 0.5, -0.3125, -0.3125},
  108. {-0.5, -0.5, 0.3125, 0.5, -0.3125, 0.5},
  109. {0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
  110. {0.3125, -0.5, 0.3125, 0.5, 0.5, 0.5},
  111. {-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
  112. {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
  113. },
  114. },
  115. selection_box = {
  116. type = "fixed",
  117. fixed = {
  118. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  119. }
  120. },
  121. })
  122. end
  123. ---------
  124. --Columns
  125. ---------
  126. --Node will be called facade:<subname>_column
  127. function facade.register_column(modname, subname, recipeitem, desc)
  128. minetest.register_node("facade:" .. subname .. "_column" , {
  129. description = desc .. " Column",
  130. drawtype = "nodebox",
  131. tiles = {
  132. "" .. modname.. "_" .. subname .. ".png",
  133. "" .. modname.. "_" .. subname .. ".png",
  134. "" .. modname.. "_" .. subname .. ".png",
  135. "" .. modname.. "_" .. subname .. ".png",
  136. "" .. modname.. "_" .. subname .. ".png^facade_column.png",
  137. "" .. modname.. "_" .. subname .. ".png^facade_column.png"
  138. },
  139. paramtype = "light",
  140. paramtype2 = "facedir",
  141. is_ground_content = false,
  142. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  143. sounds = default.node_sound_stone_defaults(),
  144. node_box = {
  145. type = "fixed",
  146. fixed = {
  147. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.4375},
  148. {-0.5, -0.5, -0.5, -0.3125, 0.5, 0.5},
  149. {0.3125, -0.5, -0.5, 0.5, 0.5, 0.5},
  150. {0.0625, -0.5, -0.5, 0.1875, 0.5, 0.5},
  151. {-0.1875, -0.5, -0.5, -0.0625, 0.5, 0.5},
  152. },
  153. },
  154. selection_box = {
  155. type = "fixed",
  156. fixed = {
  157. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  158. }
  159. },
  160. })
  161. end
  162. --Node will be called facade:<subname>_column_corner
  163. function facade.register_column_corner(modname, subname, recipeitem, desc)
  164. minetest.register_node("facade:" .. subname .. "_column_corner", {
  165. description = desc .. " Column Corner",
  166. drawtype = "nodebox",
  167. tiles = {
  168. "" .. modname.. "_" .. subname .. ".png",
  169. "" .. modname.. "_" .. subname .. ".png",
  170. "" .. modname.. "_" .. subname .. ".png^facade_column.png",
  171. "" .. modname.. "_" .. subname .. ".png^facade_column.png",
  172. "" .. modname.. "_" .. subname .. ".png^facade_column.png",
  173. "" .. modname.. "_" .. subname .. ".png^facade_column.png"
  174. },
  175. paramtype = "light",
  176. paramtype2 = "facedir",
  177. is_ground_content = false,
  178. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  179. sounds = default.node_sound_stone_defaults(),
  180. node_box = {
  181. type = "fixed",
  182. fixed = {
  183. {-0.4375, -0.5, -0.4375, 0.4375, 0.5, 0.4375},
  184. {-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
  185. {0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
  186. {0.0625, -0.5, -0.5, 0.1875, 0.5, 0.5},
  187. {-0.1875, -0.5, -0.5, -0.0625, 0.5, 0.5},
  188. {0.3125, -0.5, 0.3125, 0.5, 0.5, 0.5},
  189. {-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
  190. {-0.5, -0.5, 0.0625, 0.5, 0.5, 0.1875},
  191. {-0.5, -0.5, -0.1875, 0.5, 0.5, -0.0625},
  192. },
  193. },
  194. selection_box = {
  195. type = "fixed",
  196. fixed = {
  197. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  198. }
  199. },
  200. })
  201. end
  202. ---------
  203. --Corbels
  204. ---------
  205. --Node will be called facade:<subname>_corbel
  206. function facade.register_corbel(modname, subname, recipeitem, desc)
  207. minetest.register_node("facade:" .. subname .. "_corbel", {
  208. description = desc .. " Corbel",
  209. drawtype = "nodebox",
  210. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  211. paramtype = "light",
  212. paramtype2 = "facedir",
  213. is_ground_content = false,
  214. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  215. sounds = default.node_sound_stone_defaults(),
  216. node_box = {
  217. type = "fixed",
  218. fixed = {
  219. {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
  220. {-0.5, -0.5, 0, 0.5, 0.5, 0.5},
  221. {-0.1875, -0.3125, -0.3125, 0.1875, 0.5, 0},
  222. },
  223. },
  224. -- selection_box = {
  225. -- type = "fixed",
  226. -- fixed = {
  227. -- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  228. -- }
  229. -- },
  230. })
  231. end
  232. --Node will be called facade:<subname>_corbel_corner
  233. function facade.register_corbel_corner(modname, subname, recipeitem, desc)
  234. minetest.register_node("facade:" .. subname .. "_corbel_corner", {
  235. description = desc .. " Corbel Corner",
  236. drawtype = "nodebox",
  237. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  238. paramtype = "light",
  239. paramtype2 = "facedir",
  240. is_ground_content = false,
  241. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  242. sounds = default.node_sound_stone_defaults(),
  243. node_box = {
  244. type = "fixed",
  245. fixed = {
  246. {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
  247. {-0.5, -0.5, 0, 0, 0.5, 0.5},
  248. {0, -0.3125, -0.3125, 0.3125, 0.5, 0},
  249. },
  250. },
  251. -- selection_box = {
  252. -- type = "fixed",
  253. -- fixed = {
  254. -- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  255. -- }
  256. -- },
  257. })
  258. end
  259. --Node will be called facade:<subname>_corbel_corner_inner
  260. function facade.register_corbel_corner_inner(modname, subname, recipeitem, desc)
  261. minetest.register_node("facade:" .. subname .. "_corbel_corner_inner", {
  262. description = desc .. " Corbel Inner Corner",
  263. drawtype = "nodebox",
  264. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  265. paramtype = "light",
  266. paramtype2 = "facedir",
  267. is_ground_content = false,
  268. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  269. sounds = default.node_sound_stone_defaults(),
  270. node_box = {
  271. type = "fixed",
  272. fixed = {
  273. {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
  274. {-0.5, -0.5, 0, 0.5, 0.5, 0.5},
  275. {0, -0.3125, -0.3125, 0.3125, 0.5, 0},
  276. {-0.5, -0.5, -0.5, 0, 0.5, 0.5},
  277. },
  278. },
  279. -- selection_box = {
  280. -- type = "fixed",
  281. -- fixed = {
  282. -- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  283. -- }
  284. -- },
  285. })
  286. end
  287. --------------------------
  288. --- Carved Stones
  289. --------------------------
  290. --Node will be called facade:<subname>_carved_stone_a
  291. function facade.register_carved_stone_a(modname, subname, recipeitem, desc)
  292. minetest.register_node("facade:" .. subname .. "_carved_stone_a", {
  293. description = desc .. " Carved Stone A",
  294. drawtype = "nodebox",
  295. tiles = {
  296. "" .. modname.. "_" .. subname .. ".png",
  297. "" .. modname.. "_" .. subname .. ".png",
  298. "" .. modname.. "_" .. subname .. ".png",
  299. "" .. modname.. "_" .. subname .. ".png",
  300. "" .. modname.. "_" .. subname .. ".png",
  301. "" .. modname.. "_" .. subname .. ".png^facade_carved_stone_a.png"},
  302. paramtype = "light",
  303. paramtype2 = "facedir",
  304. is_ground_content = false,
  305. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  306. sounds = default.node_sound_stone_defaults(),
  307. node_box = {
  308. type = "fixed",
  309. fixed = {
  310. {-0.5, -0.5, -0.4375, 0.5, 0.5, 0.5},
  311. {-0.5, 0.4375, -0.5, 0.5, 0.5, -0.4375},
  312. {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  313. {-0.4375, -0.375, -0.5, -0.3125, 0.375, -0.4375},
  314. {-0.5, -0.375, -0.5, -0.3125, -0.25, 0.5},
  315. {-0.4375, 0.25, -0.5, 0.4375, 0.375, 0.5},
  316. {0.3125, -0.125, -0.5, 0.4375, 0.25, 0.5},
  317. {-0.1875, -0.375, -0.5, 0.5, -0.25, 0.5},
  318. {-0.1875, -0.25, -0.5, -0.0625, 0.125, 0.5},
  319. {0.0625, -0.125, -0.5, 0.3125, 0, 0.5},
  320. {-0.0625, 0, -0.5, 0.1875, 0.125, 0.5},
  321. },
  322. },
  323. selection_box = {
  324. type = "fixed",
  325. fixed = {
  326. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  327. },
  328. },
  329. })
  330. end
  331. --Node will be called facade:<subname>_carved_stone_a_corner
  332. function facade.register_carved_stone_a_corner(modname, subname, recipeitem, desc)
  333. minetest.register_node("facade:" .. subname .. "_carved_stone_a_corner", {
  334. description = desc .. " Carved Stone A Corner",
  335. drawtype = "nodebox",
  336. tiles = {
  337. "" .. modname.. "_" .. subname .. ".png",
  338. "" .. modname.. "_" .. subname .. ".png",
  339. "" .. modname.. "_" .. subname .. ".png",
  340. "" .. modname.. "_" .. subname .. ".png^facade_carved_stone_a.png",
  341. "" .. modname.. "_" .. subname .. ".png",
  342. "" .. modname.. "_" .. subname .. ".png^facade_carved_stone_a.png"},
  343. paramtype = "light",
  344. paramtype2 = "facedir",
  345. is_ground_content = false,
  346. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  347. sounds = default.node_sound_stone_defaults(),
  348. node_box = {
  349. type = "fixed",
  350. fixed = {
  351. {-0.4375, -0.5, -0.4375, 0.5, 0.5, 0.5},
  352. {-0.5, 0.4375, -0.5, 0.5, 0.5, -0.4375},
  353. {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  354. {-0.4375, -0.375, -0.5, -0.3125, 0.375, -0.4375},
  355. {-0.5, -0.375, -0.5, -0.3125, -0.25, 0.1875},
  356. {-0.4375, 0.25, -0.5, 0.4375, 0.375, 0.5},
  357. {0.3125, -0.125, -0.5, 0.4375, 0.25, 0.5},
  358. {-0.1875, -0.375, -0.5, 0.5, -0.25, 0.5},
  359. {-0.1875, -0.25, -0.5, -0.0625, 0.125, 0.5},
  360. {0.0625, -0.125, -0.5, 0.3125, 0, 0.5},
  361. {-0.0625, 0, -0.5, 0.1875, 0.125, 0.5},
  362. {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
  363. {-0.5, -0.125, -0.4375, 0.5, 0.375, -0.3125},
  364. {-0.5, 0.25, -0.3125, 0.5, 0.375, 0.4375},
  365. {-0.5, -0.375, 0.3125, 0.4375, 0.375, 0.4375},
  366. {-0.5, -0.375, 0.3125, 0.4375, -0.25, 0.5},
  367. {-0.5, -0.125, -0.3125, 0.4375, 0, -0.0625},
  368. {-0.5, 0, -0.1875, 0.4375, 0.125, 0.1875},
  369. {-0.5, -0.25, 0.0625, 0.4375, 0.125, 0.1875},
  370. },
  371. },
  372. selection_box = {
  373. type = "fixed",
  374. fixed = {
  375. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  376. },
  377. },
  378. })
  379. end
  380. --------------------------
  381. --- RGSpro Facia
  382. --------------------------
  383. --Node will be called facade:<subname>_rgspro
  384. function facade.register_rgspro(modname, subname, recipeitem, desc)
  385. minetest.register_node("facade:" .. subname .. "_rgspro", {
  386. description = desc .. " RGSpro",
  387. drawtype = "nodebox",
  388. tiles = {
  389. "" .. modname.. "_" .. subname .. ".png",
  390. "" .. modname.. "_" .. subname .. ".png",
  391. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  392. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  393. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  394. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png"},
  395. paramtype = "light",
  396. paramtype2 = "facedir",
  397. is_ground_content = false,
  398. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  399. sounds = default.node_sound_stone_defaults(),
  400. node_box = {
  401. type = "fixed",
  402. fixed = {
  403. {-0.5, -0.5, 0.375, 0.5, -0.3125, 0.5},
  404. {-0.5, -0.3125, 0.25, 0.5, -0.125, 0.5},
  405. {-0.5, -0.125, 0.125, 0.5, 0.5, 0.5},
  406. },
  407. },
  408. -- selection_box = {
  409. -- type = "fixed",
  410. -- fixed = {
  411. -- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  412. -- },
  413. -- },
  414. })
  415. end
  416. --Node will be called facade:<subname>_rgspro_inner_corner
  417. function facade.register_rgspro_inner_corner(modname, subname, recipeitem, desc)
  418. minetest.register_node("facade:" .. subname .. "_rgspro_inner_corner", {
  419. description = desc .. " RGSpro Inner Corner",
  420. drawtype = "nodebox",
  421. tiles = {
  422. "" .. modname.. "_" .. subname .. ".png",
  423. "" .. modname.. "_" .. subname .. ".png",
  424. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  425. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  426. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  427. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png"},
  428. paramtype = "light",
  429. paramtype2 = "facedir",
  430. is_ground_content = false,
  431. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  432. sounds = default.node_sound_stone_defaults(),
  433. node_box = {
  434. type = "fixed",
  435. fixed = {
  436. {-0.5, -0.5, 0.375, 0.5, -0.3125, 0.5},
  437. {-0.5, -0.3125, 0.25, 0.5, -0.125, 0.5},
  438. {-0.5, -0.125, 0.125, 0.5, 0.5, 0.5},
  439. {0.375, -0.5, -0.5, 0.5, -0.3125, 0.375},
  440. {0.25, -0.3125, -0.5, 0.5, -0.0625, 0.25},
  441. {0.125, -0.125, -0.5, 0.5, 0.5, 0.125},
  442. },
  443. },
  444. -- selection_box = {
  445. -- type = "fixed",
  446. -- fixed = {
  447. -- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  448. -- },
  449. -- },
  450. })
  451. end
  452. --Node will be called facade:<subname>_rgspro_outer_corner
  453. function facade.register_rgspro_outer_corner(modname, subname, recipeitem, desc)
  454. minetest.register_node("facade:" .. subname .. "_rgspro_outer_corner", {
  455. description = desc .. " RGSpro Outer Corner",
  456. drawtype = "nodebox",
  457. tiles = {
  458. "" .. modname.. "_" .. subname .. ".png",
  459. "" .. modname.. "_" .. subname .. ".png",
  460. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  461. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  462. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png",
  463. "" .. modname.. "_" .. subname .. ".png^facade_rgspro.png"},
  464. paramtype = "light",
  465. paramtype2 = "facedir",
  466. is_ground_content = false,
  467. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  468. sounds = default.node_sound_stone_defaults(),
  469. node_box = {
  470. type = "fixed",
  471. fixed = {
  472. {-0.5, -0.5, 0.375, 0.5, -0.3125, 0.5},
  473. {-0.5, -0.3125, 0.25, 0.5, -0.0625, 0.5},
  474. {-0.5, -0.125, 0.125, 0.5, 0.5, 0.5},
  475. {-0.625, -0.5, 0.375, -0.5, -0.3125, 1.5},
  476. {-0.75, -0.3125, 0.25, -0.5, -0.125, 1.5},
  477. {-0.875, -0.125, 0.125, -0.5, 0.5, 1.5},
  478. },
  479. },
  480. -- selection_box = {
  481. -- type = "fixed",
  482. -- fixed = {
  483. -- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  484. -- },
  485. -- },
  486. })
  487. end
  488. --------------------------
  489. --- Corner Bricks
  490. --------------------------
  491. --Node will be called facade:<subname>_corner_bricks
  492. function facade.register_corner_bricks(modname, subname, recipeitem, desc)
  493. if not string.match(recipeitem,"clay")
  494. then -- do not do for clay things that is ugly
  495. minetest.register_node("facade:" .. subname .. "_corner_bricks", {
  496. description = desc .. " Corner Bricks",
  497. drawtype = "nodebox",
  498. tiles = {
  499. "" .. modname.. "_" .. subname .. "_brick.png"},
  500. paramtype = "light",
  501. paramtype2 = "facedir",
  502. is_ground_content = false,
  503. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  504. sounds = default.node_sound_stone_defaults(),
  505. node_box = {
  506. type = "fixed",
  507. fixed = {
  508. {-0.5625, -0.5, 0.4375, -0.5, 0, 1},
  509. {-0.5, -0.5, 0.4375, 0, 0, 0.5},
  510. {-0.5625, 0, 0.5, -0.5, 0.5, 1.5},
  511. {-0.5625, 0, 0.4375, 0.5, 0.5, 0.5},
  512. },
  513. },
  514. })
  515. end
  516. end
  517. --------------------------
  518. --- Columnia shapes
  519. --------------------------
  520. -- From mod Columnia (2014 by Glunggi), LGPL 2.1
  521. -- The shapes are using stock minetest.rotate_node() for positioning.
  522. -- These shapes should not be registered if the regular columnia mod is in use
  523. if not minetest.get_modpath("columnia") then
  524. local columnia_rotate = function(itemstack, placer, pointed_thing)
  525. if pointed_thing.type ~= "node" then
  526. return itemstack
  527. end
  528. local p0 = pointed_thing.under
  529. local p1 = pointed_thing.above
  530. local param2 = 0
  531. local placer_pos = placer:getpos()
  532. if placer_pos then
  533. local dir = {
  534. x = p1.x - placer_pos.x,
  535. y = p1.y - placer_pos.y,
  536. z = p1.z - placer_pos.z
  537. }
  538. param2 = minetest.dir_to_facedir(dir)
  539. end
  540. if p0.y-1 == p1.y then
  541. param2 = param2 + 20
  542. if param2 == 21 then
  543. param2 = 23
  544. elseif param2 == 23 then
  545. param2 = 21
  546. end
  547. end
  548. return minetest.item_place(itemstack, placer, pointed_thing, param2)
  549. end
  550. -- Node will be called facade:<subname>_columnia_mid
  551. function facade.register_columnia_mid(modname, subname, recipeitem, desc)
  552. minetest.register_node("facade:" .. subname .. "_columnia_mid", {
  553. description = desc .. " Column Middle",
  554. drawtype = "nodebox",
  555. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  556. paramtype = "light",
  557. paramtype2 = "facedir",
  558. is_ground_content = false,
  559. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  560. sounds = default.node_sound_stone_defaults(),
  561. on_place = minetest.rotate_node,
  562. node_box = {
  563. type = "fixed",
  564. fixed = {
  565. {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
  566. },
  567. },
  568. })
  569. end
  570. -- Normally, a single shape should be fine both for bottom and top parts of
  571. -- a column. If materials with textures that don't match with themselves
  572. -- when rotated upside-down are added later on, then enable the next function.
  573. -- Node will be called facade:<subname>_columnia_bottom
  574. function facade.register_columnia_bottom(modname, subname, recipeitem, desc)
  575. minetest.register_node("facade:" .. subname .. "_columnia_bottom", {
  576. description = desc .. " Column Bottom/Top",
  577. drawtype = "nodebox",
  578. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  579. paramtype = "light",
  580. paramtype2 = "facedir",
  581. is_ground_content = false,
  582. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  583. sounds = default.node_sound_stone_defaults(),
  584. on_place = minetest.rotate_node,
  585. node_box = {
  586. type = "fixed",
  587. fixed = {
  588. {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
  589. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  590. {-0.375, -0.5, -0.375, 0.375, 0, 0.375},
  591. },
  592. },
  593. })
  594. end
  595. --[[
  596. -- This function is commented out, because in the current state, when facade mod
  597. -- uses materials without directional textures, having one shape for top
  598. -- and bottom of columns is enough. However, for materials which have textures
  599. -- that, when rotated, clearly stop matching the other blocks, this function
  600. -- is preserved.
  601. -- Node will be called facade:<subname>_columnia_top
  602. function facade.register_columnia_top(modname, subname, recipeitem, desc)
  603. -- whitelist items with textures of clear directionality (e.g. bricks)
  604. if string.match(recipeitem, "brick")
  605. then
  606. minetest.register_node("facade:" .. subname .. "_columnia_top", {
  607. description = desc .. " Column Top/Bottom",
  608. drawtype = "nodebox",
  609. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  610. paramtype = "light",
  611. paramtype2 = "facedir",
  612. is_ground_content = false,
  613. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  614. sounds = default.node_sound_stone_defaults(),
  615. on_place = minetest.rotate_node,
  616. node_box = {
  617. type = "fixed",
  618. fixed = {
  619. {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
  620. {-0.5, 0.25, -0.5, 0.5, 0.5, 0.5},
  621. {-0.375, 0, -0.375, 0.375, 0.5, 0.375},
  622. },
  623. },
  624. })
  625. end
  626. end
  627. ]]--
  628. -- Node will be called facade:<subname>_columnia_crosslink
  629. function facade.register_columnia_crosslink(modname, subname, recipeitem, desc)
  630. minetest.register_node("facade:" .. subname .. "_columnia_crosslink", {
  631. description = desc .. " Column Crosslink",
  632. drawtype = "nodebox",
  633. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  634. paramtype = "light",
  635. paramtype2 = "facedir",
  636. is_ground_content = false,
  637. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  638. sounds = default.node_sound_stone_defaults(),
  639. on_place = columnia_rotate,
  640. node_box = {
  641. type = "fixed",
  642. fixed = {
  643. {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
  644. {-0.5, 0, -0.25, 0.5, 0.5, 0.25},
  645. {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
  646. {-0.4375, 0.0625, -0.4375, 0.4375, 0.4375, 0.4375},
  647. },
  648. },
  649. })
  650. end
  651. -- Node will be called facade:<subname>_columnia_link
  652. function facade.register_columnia_link(modname, subname, recipeitem, desc)
  653. minetest.register_node("facade:" .. subname .. "_columnia_link", {
  654. description = desc .. " Column Link",
  655. drawtype = "nodebox",
  656. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  657. paramtype = "light",
  658. paramtype2 = "facedir",
  659. is_ground_content = false,
  660. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  661. sounds = default.node_sound_stone_defaults(),
  662. on_place = columnia_rotate,
  663. node_box = {
  664. type = "fixed",
  665. fixed = {
  666. {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
  667. },
  668. },
  669. })
  670. end
  671. -- Node will be called facade:<subname>_columnia_linkdown
  672. function facade.register_columnia_linkdown(modname, subname, recipeitem, desc)
  673. minetest.register_node("facade:" .. subname .. "_columnia_linkdown", {
  674. description = desc .. " Column Linkdown",
  675. drawtype = "nodebox",
  676. tiles = {"" .. modname.. "_" .. subname .. ".png"},
  677. paramtype = "light",
  678. paramtype2 = "facedir",
  679. is_ground_content = false,
  680. groups = {cracky = 3, oddly_breakable_by_hand = 2, stone = 1},
  681. sounds = default.node_sound_stone_defaults(),
  682. on_place = columnia_rotate,
  683. node_box = {
  684. type = "fixed",
  685. fixed = {
  686. {-0.25, 0, -0.5, 0.25, 0.5, 0.5},
  687. {-0.125, -0.5, -0.125, 0.125, 0, 0.125},
  688. {-0.1875, -0.5, -0.1875, 0.1875, -0.375, 0.1875},
  689. {-0.1875, -0.125, -0.1875, 0.1875, 0, 0.1875},
  690. },
  691. },
  692. })
  693. end
  694. end
  695. --------------------------
  696. --Register Nodes
  697. --------------------------
  698. function facade.register_facade_nodes(modname, subname, recipeitem, desc)
  699. facade.register_bannerstone(modname, subname, recipeitem, desc)
  700. facade.register_bannerstone_corner(modname, subname, recipeitem, desc)
  701. facade.register_centerstone(modname, subname, recipeitem, desc)
  702. facade.register_column(modname, subname, recipeitem, desc)
  703. facade.register_column_corner(modname, subname, recipeitem, desc)
  704. facade.register_corbel(modname, subname, recipeitem, desc)
  705. facade.register_corbel_corner(modname, subname, recipeitem, desc)
  706. facade.register_corbel_corner_inner(modname, subname, recipeitem, desc)
  707. facade.register_carved_stone_a(modname, subname, recipeitem, desc)
  708. facade.register_carved_stone_a_corner(modname, subname, recipeitem, desc)
  709. facade.register_rgspro(modname, subname, recipeitem, desc)
  710. facade.register_rgspro_inner_corner(modname, subname, recipeitem, desc)
  711. facade.register_rgspro_outer_corner(modname, subname, recipeitem, desc)
  712. facade.register_corner_bricks(modname, subname, recipeitem, desc)
  713. if not minetest.get_modpath("columnia") then
  714. facade.register_columnia_mid(modname, subname, recipeitem, desc)
  715. facade.register_columnia_bottom(modname, subname, recipeitem, desc)
  716. --facade.register_columnia_top(modname, subname, recipeitem, desc)
  717. facade.register_columnia_crosslink(modname, subname, recipeitem, desc)
  718. facade.register_columnia_link(modname, subname, recipeitem, desc)
  719. facade.register_columnia_linkdown(modname, subname, recipeitem, desc)
  720. end
  721. if wehavechisels then
  722. -- register all nodes with mychisel mod to use them without creative priv
  723. chisel.register_node("facade",subname, recipeitem, "bannerstone")
  724. chisel.register_node("facade",subname, recipeitem, "bannerstone_corner")
  725. chisel.register_node("facade",subname, recipeitem, "centerstone")
  726. chisel.register_node("facade",subname, recipeitem, "column")
  727. chisel.register_node("facade",subname, recipeitem, "column_corner")
  728. chisel.register_node("facade",subname, recipeitem, "corbel")
  729. chisel.register_node("facade",subname, recipeitem, "corbel_corner")
  730. chisel.register_node("facade",subname, recipeitem, "corbel_corner_inner")
  731. chisel.register_node("facade",subname, recipeitem, "carved_stone_a")
  732. chisel.register_node("facade",subname, recipeitem, "carved_stone_a_corner")
  733. chisel.register_node("facade",subname, recipeitem, "rgspro")
  734. chisel.register_node("facade",subname, recipeitem, "rgspro_inner_corner")
  735. chisel.register_node("facade",subname, recipeitem, "rgspro_outer_corner")
  736. chisel.register_node("facade",subname, recipeitem, "corner_bricks")
  737. if not minetest.get_modpath("columnia") then
  738. chisel.register_node("facade",subname, recipeitem, "columnia_mid")
  739. chisel.register_node("facade",subname, recipeitem, "columnia_bottom")
  740. --chisel.register_node("facade",subname, recipeitem, "columnia_top")
  741. chisel.register_node("facade",subname, recipeitem, "columnia_crosslink")
  742. chisel.register_node("facade",subname, recipeitem, "columnia_link")
  743. chisel.register_node("facade",subname, recipeitem, "columnia_linkdown")
  744. end
  745. end
  746. end
  747. -- register the total number of different designs in this mod with mychisel
  748. if wehavechisels then chisel.add_mod("facade",14) end