nodes.lua 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. mymillwork.registered = {}
  2. mymillwork.nodes = {
  3. { suffix = "crownmould",
  4. model = "mymillwork_mach1.obj",
  5. mdesc = "Crown Mould",
  6. sbox = { type = "fixed",
  7. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  8. {-0.5, -0.375, 0.125, 0.5, -0.125, 0.375},
  9. {-0.5, -0.375, 0.375, 0.5, 0.5, 0.5},
  10. }
  11. },
  12. cbox = { type = "fixed",
  13. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  14. {-0.5, -0.375, 0.125, 0.5, -0.125, 0.375},
  15. {-0.5, -0.375, 0.375, 0.5, 0.5, 0.5},
  16. }
  17. },
  18. },
  19. { suffix = "crownmould_ic",
  20. model = "mymillwork_mach2.obj",
  21. mdesc = "Crown Mould IC",
  22. sbox = { type = "fixed",
  23. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  24. {-0.5, -0.375, 0.125, 0.375, -0.125, 0.375},
  25. {0.125, -0.375, -0.5, 0.375, -0.125, 0.125},
  26. {-0.5, -0.375, 0.375, 0.5, 0.5, 0.5},
  27. {0.375, -0.375, -0.5, 0.5, 0.5, 0.375},
  28. }
  29. },
  30. cbox = { type = "fixed",
  31. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  32. {-0.5, -0.375, 0.125, 0.375, -0.125, 0.375},
  33. {0.125, -0.375, -0.5, 0.375, -0.125, 0.125},
  34. {-0.5, -0.375, 0.375, 0.5, 0.5, 0.5},
  35. {0.375, -0.375, -0.5, 0.5, 0.5, 0.375},
  36. }
  37. },
  38. },
  39. { suffix = "crownmould_oc",
  40. model = "mymillwork_mach3.obj",
  41. mdesc = "Crown Mould OC",
  42. sbox = { type = "fixed",
  43. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  44. {-0.5, -0.375, 0.125, -0.125, -0.125, 0.5},
  45. {-0.5, -0.125, 0.375, -0.375, 0.5, 0.5},
  46. }
  47. },
  48. cbox = { type = "fixed",
  49. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  50. {-0.5, -0.375, 0.125, -0.125, -0.125, 0.5},
  51. {-0.5, -0.125, 0.375, -0.375, 0.5, 0.5},
  52. }
  53. },
  54. },
  55. { suffix = "crownmould_beam",
  56. model = "mymillwork_mach4.obj",
  57. mdesc = "Crown Mould with Beam",
  58. sbox = { type = "fixed",
  59. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  60. {-0.5, -0.375, 0.125, 0.5, -0.125, 0.375},
  61. {-0.25, -0.375, -0.5, 0.25, -0.1875, 0.125},
  62. {-0.5, -0.375, 0.375, 0.5, 0.5, 0.5},
  63. }
  64. },
  65. cbox = { type = "fixed",
  66. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  67. {-0.5, -0.375, 0.125, 0.5, -0.125, 0.375},
  68. {-0.25, -0.375, -0.5, 0.25, -0.1875, 0.125},
  69. {-0.5, -0.375, 0.375, 0.5, 0.5, 0.5},
  70. }
  71. },
  72. },
  73. { suffix = "column",
  74. model = "mymillwork_mach5.obj",
  75. mdesc = "Column",
  76. sbox = { type = "fixed",
  77. fixed = {{-0.5,-0.5,-0.5,0.5,0.5,0.5},
  78. }
  79. },
  80. cbox = { type = "fixed",
  81. fixed = {{-0.5,-0.5,-0.5,0.5,0.5,0.5},
  82. }
  83. },
  84. },
  85. { suffix = "column_base",
  86. model = "mymillwork_mach6.obj",
  87. mdesc = "Column Base",
  88. sbox = { type = "fixed",
  89. fixed = {{-0.5,-0.5,-0.5,0.5,0.5,0.5},
  90. }
  91. },
  92. cbox = { type = "fixed",
  93. fixed = {{-0.5,-0.5,-0.5,0.5,0.5,0.5},
  94. }
  95. },
  96. },
  97. { suffix = "column_half",
  98. model = "mymillwork_mach7.obj",
  99. mdesc = "Half Column",
  100. sbox = { type = "fixed",
  101. fixed = {{-0.5,-0.5,0.0,0.5,0.5,0.5},
  102. }
  103. },
  104. cbox = { type = "fixed",
  105. fixed = {{-0.5,-0.5,0.0,0.5,0.5,0.5},
  106. }
  107. },
  108. },
  109. { suffix = "column_half_base",
  110. model = "mymillwork_mach8.obj",
  111. mdesc = "Half Column Base",
  112. sbox = { type = "fixed",
  113. fixed = {{-0.5,-0.5,0.0,0.5,0.5,0.5},
  114. }
  115. },
  116. cbox = { type = "fixed",
  117. fixed = {{-0.5,-0.5,0.0,0.5,0.5,0.5},
  118. }
  119. },
  120. },
  121. { suffix = "column_half_wbeam",
  122. model = "mymillwork_mach9.obj",
  123. mdesc = "Half Column Base With Beam",
  124. sbox = { type = "fixed",
  125. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  126. {-0.5, -0.375, 0.0, 0.5, 0.5, 0.5},
  127. {-0.25, -0.375, -0.5, 0.25, -0.1875, 0.0},
  128. }
  129. },
  130. cbox = { type = "fixed",
  131. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  132. {-0.5, -0.375, 0.0, 0.5, 0.5, 0.5},
  133. {-0.25, -0.375, -0.5, 0.25, -0.1875, 0.0},
  134. }
  135. },
  136. },
  137. { suffix = "column_quarter",
  138. model = "mymillwork_mach10.obj",
  139. mdesc = "Quarter Column",
  140. sbox = { type = "fixed",
  141. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  142. }
  143. },
  144. cbox = { type = "fixed",
  145. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  146. }
  147. },
  148. },
  149. { suffix = "column_quarter_base",
  150. model = "mymillwork_mach11.obj",
  151. mdesc = "Quarter Column Base",
  152. sbox = { type = "fixed",
  153. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  154. }
  155. },
  156. cbox = { type = "fixed",
  157. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  158. }
  159. },
  160. },
  161. { suffix = "column_quarter_wbase",
  162. model = "mymillwork_mach12.obj",
  163. mdesc = "Quarter Column Base Baseboard",
  164. sbox = { type = "fixed",
  165. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  166. {0.0, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  167. {-0.5, -0.5, -0.5, -0.4375, -0.1875, 0.0},
  168. }
  169. },
  170. cbox = { type = "fixed",
  171. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  172. {0.0, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  173. {-0.5, -0.5, -0.5, -0.4375, -0.1875, 0.0},
  174. }
  175. },
  176. },
  177. { suffix = "column_quarter_fancybase",
  178. model = "mymillwork_mach13.obj",
  179. mdesc = "Quarter Column Base Fancy Baseboard",
  180. sbox = { type = "fixed",
  181. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  182. {0.0, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  183. {-0.5, -0.5, -0.5, -0.3125, 0.1875, 0.0},
  184. }
  185. },
  186. cbox = { type = "fixed",
  187. fixed = {{-0.5,-0.5,0,0,0.5,0.5},
  188. {0.0, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  189. {-0.5, -0.5, -0.5, -0.3125, 0.1875, 0.0},
  190. }
  191. },
  192. },
  193. { suffix = "ceiling",
  194. model = "mymillwork_mach14.obj",
  195. mdesc = "Ceiling",
  196. sbox = { type = "fixed",
  197. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  198. }
  199. },
  200. cbox = { type = "fixed",
  201. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  202. }
  203. },
  204. },
  205. { suffix = "ceiling_post",
  206. model = "mymillwork_mach15.obj",
  207. mdesc = "Ceiling with Post",
  208. sbox = { type = "fixed",
  209. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  210. {-0.125, -0.4375, -0.125, 0.125, 0.5, 0.125},
  211. }
  212. },
  213. cbox = { type = "fixed",
  214. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  215. {-0.125, -0.4375, -0.125, 0.125, 0.5, 0.125},
  216. }
  217. },
  218. },
  219. { suffix = "beam",
  220. model = "mymillwork_mach16.obj",
  221. mdesc = "Beam",
  222. sbox = { type = "fixed",
  223. fixed = {{-0.25, -0.5, -0.5, 0.25, -0.1875, 0.5},
  224. }
  225. },
  226. cbox = { type = "fixed",
  227. fixed = {{-0.25, -0.5, -0.5, 0.25, -0.1875, 0.5},
  228. }
  229. },
  230. },
  231. { suffix = "beam_t",
  232. model = "mymillwork_mach17.obj",
  233. mdesc = "Beam T",
  234. sbox = { type = "fixed",
  235. fixed = {{-0.5, -0.5, -0.25, -0.25, -0.1875, 0.25},
  236. {-0.25, -0.5, -0.5, 0.25, -0.1875, 0.5},
  237. {0.25, -0.5, -0.25, 0.5, -0.1875, 0.25},
  238. }
  239. },
  240. cbox = { type = "fixed",
  241. fixed = {{-0.5, -0.5, -0.25, -0.25, -0.1875, 0.25},
  242. {-0.25, -0.5, -0.5, 0.25, -0.1875, 0.5},
  243. {0.25, -0.5, -0.25, 0.5, -0.1875, 0.25},
  244. }
  245. },
  246. },
  247. { suffix = "beam_ceiling_t",
  248. model = "mymillwork_mach18.obj",
  249. mdesc = "Ceiling with Beam T",
  250. sbox = { type = "fixed",
  251. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  252. {-0.5, -0.4375, -0.25, -0.25, -0.1875, 0.25},
  253. {-0.25, -0.4375, -0.5, 0.25, -0.1875, 0.5},
  254. {0.25, -0.4375, -0.25, 0.5, -0.1875, 0.25},
  255. }
  256. },
  257. cbox = { type = "fixed",
  258. fixed = {{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  259. {-0.5, -0.4375, -0.25, -0.25, -0.1875, 0.25},
  260. {-0.25, -0.4375, -0.5, 0.25, -0.1875, 0.5},
  261. {0.25, -0.4375, -0.25, 0.5, -0.1875, 0.25},
  262. }
  263. },
  264. },
  265. { suffix = "base",
  266. model = "mymillwork_mach19.obj",
  267. mdesc = "Baseboard",
  268. sbox = { type = "fixed",
  269. fixed = {{-0.5, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  270. }
  271. },
  272. cbox = { type = "fixed",
  273. fixed = {{-0.5, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  274. }
  275. },
  276. },
  277. { suffix = "base_ic",
  278. model = "mymillwork_mach20.obj",
  279. mdesc = "Baseboard IC",
  280. sbox = { type = "fixed",
  281. fixed = {{-0.5, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  282. {-0.5, -0.5, -0.5, -0.4375, -0.1875, 0.4375},
  283. }
  284. },
  285. cbox = { type = "fixed",
  286. fixed = {{-0.5, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  287. }
  288. },
  289. },
  290. { suffix = "base_oc",
  291. model = "mymillwork_mach21.obj",
  292. mdesc = "Baseboard OC",
  293. sbox = { type = "fixed",
  294. fixed = {{0.4375, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  295. }
  296. },
  297. cbox = { type = "fixed",
  298. fixed = {{-0.5, -0.5, 0.4375, 0.5, -0.1875, 0.5},
  299. }
  300. },
  301. },
  302. { suffix = "base_fancy",
  303. model = "mymillwork_mach22.obj",
  304. mdesc = "Fancy Baseboard",
  305. sbox = { type = "fixed",
  306. fixed = {{-0.5, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  307. }
  308. },
  309. cbox = { type = "fixed",
  310. fixed = {{-0.5, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  311. }
  312. },
  313. },
  314. { suffix = "base_fancy_ic",
  315. model = "mymillwork_mach23.obj",
  316. mdesc = "Fancy Baseboard IC",
  317. sbox = { type = "fixed",
  318. fixed = {{-0.5, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  319. {-0.5, -0.5, -0.5, -0.3125, 0.1875, 0.3125},
  320. }
  321. },
  322. cbox = { type = "fixed",
  323. fixed = {{-0.5, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  324. {-0.5, -0.5, -0.5, -0.3125, 0.1875, 0.3125},
  325. }
  326. },
  327. },
  328. { suffix = "base_fancy_oc",
  329. model = "mymillwork_mach24.obj",
  330. mdesc = "Fancy Baseboard OC",
  331. sbox = { type = "fixed",
  332. fixed = {{0.3125, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  333. }
  334. },
  335. cbox = { type = "fixed",
  336. fixed = {{0.3125, -0.5, 0.3125, 0.5, 0.1875, 0.5},
  337. }
  338. },
  339. },
  340. }
  341. function mymillwork.register(material, node_suffix, desc, image, group)
  342. for __, data in ipairs(mymillwork.nodes) do
  343. mymillwork.register_all(data.suffix, data.model, data.mdesc, data.sbox, data.cbox,
  344. node_suffix, material, desc, image, group)
  345. end
  346. end
  347. function mymillwork.register_all(suffix, model, mdesc, sbox, cbox, node_suffix, material, desc, image, group)
  348. minetest.register_node("mymillwork:" .. suffix .. "_" .. node_suffix, {
  349. description = desc .. " " .. mdesc,
  350. drawtype = "mesh",
  351. mesh = model,
  352. tiles = { image },
  353. selection_box = sbox,
  354. collision_box = cbox,
  355. paramtype = "light",
  356. paramtype2 = "facedir",
  357. groups = group,
  358. on_place = minetest.rotate_node,
  359. })
  360. table.insert(mymillwork.registered, {material, node_suffix})
  361. end