defs.lua 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. --[[
  2. More Blocks: registrations
  3. Copyright © 2011-2020 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. local box_slope = {
  7. type = "fixed",
  8. fixed = {
  9. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  10. {-0.5, -0.25, -0.25, 0.5, 0, 0.5},
  11. {-0.5, 0, 0, 0.5, 0.25, 0.5},
  12. {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5}
  13. }
  14. }
  15. local box_slope_half = {
  16. type = "fixed",
  17. fixed = {
  18. {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  19. {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5},
  20. {-0.5, -0.25, 0, 0.5, -0.125, 0.5},
  21. {-0.5, -0.125, 0.25, 0.5, 0, 0.5},
  22. }
  23. }
  24. local box_slope_half_raised = {
  25. type = "fixed",
  26. fixed = {
  27. {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
  28. {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
  29. {-0.5, 0.25, 0, 0.5, 0.375, 0.5},
  30. {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
  31. }
  32. }
  33. --==============================================================
  34. local box_slope_inner = {
  35. type = "fixed",
  36. fixed = {
  37. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  38. {-0.5, -0.5, -0.25, 0.5, 0, 0.5},
  39. {-0.5, -0.5, -0.5, 0.25, 0, 0.5},
  40. {-0.5, 0, -0.5, 0, 0.25, 0.5},
  41. {-0.5, 0, 0, 0.5, 0.25, 0.5},
  42. {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5},
  43. {-0.5, 0.25, -0.5, -0.25, 0.5, 0.5},
  44. }
  45. }
  46. local box_slope_inner_half = {
  47. type = "fixed",
  48. fixed = {
  49. {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  50. {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5},
  51. {-0.5, -0.375, -0.5, 0.25, -0.25, 0.5},
  52. {-0.5, -0.25, -0.5, 0, -0.125, 0.5},
  53. {-0.5, -0.25, 0, 0.5, -0.125, 0.5},
  54. {-0.5, -0.125, 0.25, 0.5, 0, 0.5},
  55. {-0.5, -0.125, -0.5, -0.25, 0, 0.5},
  56. }
  57. }
  58. local box_slope_inner_half_raised = {
  59. type = "fixed",
  60. fixed = {
  61. {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
  62. {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
  63. {-0.5, 0.125, -0.5, 0.25, 0.25, 0.5},
  64. {-0.5, 0.25, -0.5, 0, 0.375, 0.5},
  65. {-0.5, 0.25, 0, 0.5, 0.375, 0.5},
  66. {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
  67. {-0.5, 0.375, -0.5, -0.25, 0.5, 0.5},
  68. }
  69. }
  70. --==============================================================
  71. local box_slope_outer = {
  72. type = "fixed",
  73. fixed = {
  74. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  75. {-0.5, -0.25, -0.25, 0.25, 0, 0.5},
  76. {-0.5, 0, 0, 0, 0.25, 0.5},
  77. {-0.5, 0.25, 0.25, -0.25, 0.5, 0.5}
  78. }
  79. }
  80. local box_slope_outer_half = {
  81. type = "fixed",
  82. fixed = {
  83. {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
  84. {-0.5, -0.375, -0.25, 0.25, -0.25, 0.5},
  85. {-0.5, -0.25, 0, 0, -0.125, 0.5},
  86. {-0.5, -0.125, 0.25, -0.25, 0, 0.5}
  87. }
  88. }
  89. local box_slope_outer_half_raised = {
  90. type = "fixed",
  91. fixed = {
  92. {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
  93. {-0.5, 0.125, -0.25, 0.25, 0.25, 0.5},
  94. {-0.5, 0.25, 0, 0, 0.375, 0.5},
  95. {-0.5, 0.375, 0.25, -0.25, 0.5, 0.5}
  96. }
  97. }
  98. stairsplus.defs = {
  99. ["micro"] = {
  100. [""] = {
  101. node_box = {
  102. type = "fixed",
  103. fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
  104. },
  105. },
  106. ["_1"] = {
  107. node_box = {
  108. type = "fixed",
  109. fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5},
  110. },
  111. },
  112. ["_2"] = {
  113. node_box = {
  114. type = "fixed",
  115. fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5},
  116. },
  117. },
  118. ["_4"] = {
  119. node_box = {
  120. type = "fixed",
  121. fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5},
  122. },
  123. },
  124. ["_12"] = {
  125. node_box = {
  126. type = "fixed",
  127. fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5},
  128. },
  129. },
  130. ["_14"] = {
  131. node_box = {
  132. type = "fixed",
  133. fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5},
  134. },
  135. },
  136. ["_15"] = {
  137. node_box = {
  138. type = "fixed",
  139. fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5},
  140. },
  141. }
  142. },
  143. ["panel"] = {
  144. [""] = {
  145. node_box = {
  146. type = "fixed",
  147. fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
  148. },
  149. },
  150. ["_1"] = {
  151. node_box = {
  152. type = "fixed",
  153. fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5},
  154. },
  155. },
  156. ["_2"] = {
  157. node_box = {
  158. type = "fixed",
  159. fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
  160. },
  161. },
  162. ["_4"] = {
  163. node_box = {
  164. type = "fixed",
  165. fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5},
  166. },
  167. },
  168. ["_12"] = {
  169. node_box = {
  170. type = "fixed",
  171. fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5},
  172. },
  173. },
  174. ["_14"] = {
  175. node_box = {
  176. type = "fixed",
  177. fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5},
  178. },
  179. },
  180. ["_15"] = {
  181. node_box = {
  182. type = "fixed",
  183. fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5},
  184. },
  185. }
  186. },
  187. ["slab"] = {
  188. [""] = 8,
  189. ["_quarter"] = 4,
  190. ["_three_quarter"] = 12,
  191. ["_1"] = 1,
  192. ["_2"] = 2,
  193. ["_14"] = 14,
  194. ["_15"] = 15,
  195. ["_two_sides"] = {
  196. { -0.5, -0.5, -0.5, 0.5, -7/16, 7/16 },
  197. { -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 }
  198. },
  199. ["_three_sides"] = {
  200. { -7/16, -0.5, -0.5, 0.5, -7/16, 7/16 },
  201. { -7/16, -0.5, 7/16, 0.5, 0.5, 0.5 },
  202. { -0.5, -0.5, -0.5, -7/16, 0.5, 0.5 }
  203. },
  204. ["_three_sides_u"] = {
  205. { -0.5, -0.5, -0.5, 0.5, 0.5, -7/16 },
  206. { -0.5, -0.5, -7/16, 0.5, -7/16, 7/16 },
  207. { -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 }
  208. }
  209. },
  210. ["slope"] = {
  211. [""] = {
  212. mesh = "moreblocks_slope.obj",
  213. collision_box = box_slope,
  214. selection_box = box_slope,
  215. },
  216. ["_half"] = {
  217. mesh = "moreblocks_slope_half.obj",
  218. collision_box = box_slope_half,
  219. selection_box = box_slope_half,
  220. },
  221. ["_half_raised"] = {
  222. mesh = "moreblocks_slope_half_raised.obj",
  223. collision_box = box_slope_half_raised,
  224. selection_box = box_slope_half_raised,
  225. },
  226. --==============================================================
  227. ["_inner"] = {
  228. mesh = "moreblocks_slope_inner.obj",
  229. collision_box = box_slope_inner,
  230. selection_box = box_slope_inner,
  231. },
  232. ["_inner_half"] = {
  233. mesh = "moreblocks_slope_inner_half.obj",
  234. collision_box = box_slope_inner_half,
  235. selection_box = box_slope_inner_half,
  236. },
  237. ["_inner_half_raised"] = {
  238. mesh = "moreblocks_slope_inner_half_raised.obj",
  239. collision_box = box_slope_inner_half_raised,
  240. selection_box = box_slope_inner_half_raised,
  241. },
  242. --==============================================================
  243. ["_inner_cut"] = {
  244. mesh = "moreblocks_slope_inner_cut.obj",
  245. collision_box = box_slope_inner,
  246. selection_box = box_slope_inner,
  247. },
  248. ["_inner_cut_half"] = {
  249. mesh = "moreblocks_slope_inner_cut_half.obj",
  250. collision_box = box_slope_inner_half,
  251. selection_box = box_slope_inner_half,
  252. },
  253. ["_inner_cut_half_raised"] = {
  254. mesh = "moreblocks_slope_inner_cut_half_raised.obj",
  255. collision_box = box_slope_inner_half_raised,
  256. selection_box = box_slope_inner_half_raised,
  257. },
  258. --==============================================================
  259. ["_outer"] = {
  260. mesh = "moreblocks_slope_outer.obj",
  261. collision_box = box_slope_outer,
  262. selection_box = box_slope_outer,
  263. },
  264. ["_outer_half"] = {
  265. mesh = "moreblocks_slope_outer_half.obj",
  266. collision_box = box_slope_outer_half,
  267. selection_box = box_slope_outer_half,
  268. },
  269. ["_outer_half_raised"] = {
  270. mesh = "moreblocks_slope_outer_half_raised.obj",
  271. collision_box = box_slope_outer_half_raised,
  272. selection_box = box_slope_outer_half_raised,
  273. },
  274. --==============================================================
  275. ["_outer_cut"] = {
  276. mesh = "moreblocks_slope_outer_cut.obj",
  277. collision_box = box_slope_outer,
  278. selection_box = box_slope_outer,
  279. },
  280. ["_outer_cut_half"] = {
  281. mesh = "moreblocks_slope_outer_cut_half.obj",
  282. collision_box = box_slope_outer_half,
  283. selection_box = box_slope_outer_half,
  284. },
  285. ["_outer_cut_half_raised"] = {
  286. mesh = "moreblocks_slope_outer_cut_half_raised.obj",
  287. collision_box = box_slope_outer_half_raised,
  288. selection_box = box_slope_outer_half_raised,
  289. },
  290. ["_cut"] = {
  291. mesh = "moreblocks_slope_cut.obj",
  292. collision_box = box_slope_outer,
  293. selection_box = box_slope_outer,
  294. },
  295. },
  296. ["stair"] = {
  297. [""] = {
  298. node_box = {
  299. type = "fixed",
  300. fixed = {
  301. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  302. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  303. },
  304. },
  305. },
  306. ["_half"] = {
  307. node_box = {
  308. type = "fixed",
  309. fixed = {
  310. {-0.5, -0.5, -0.5, 0, 0, 0.5},
  311. {-0.5, 0, 0, 0, 0.5, 0.5},
  312. },
  313. },
  314. },
  315. ["_right_half"] = {
  316. node_box = {
  317. type = "fixed",
  318. fixed = {
  319. {0, -0.5, -0.5, 0.5, 0, 0.5},
  320. {0, 0, 0, 0.5, 0.5, 0.5},
  321. },
  322. },
  323. },
  324. ["_inner"] = {
  325. node_box = {
  326. type = "fixed",
  327. fixed = {
  328. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  329. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  330. {-0.5, 0, -0.5, 0, 0.5, 0},
  331. },
  332. },
  333. },
  334. ["_outer"] = {
  335. node_box = {
  336. type = "fixed",
  337. fixed = {
  338. {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  339. {-0.5, 0, 0, 0, 0.5, 0.5},
  340. },
  341. },
  342. },
  343. ["_alt"] = {
  344. node_box = {
  345. type = "fixed",
  346. fixed = {
  347. {-0.5, -0.5, -0.5, 0.5, 0, 0},
  348. {-0.5, 0, 0, 0.5, 0.5, 0.5},
  349. },
  350. },
  351. },
  352. ["_alt_1"] = {
  353. node_box = {
  354. type = "fixed",
  355. fixed = {
  356. {-0.5, -0.0625, -0.5, 0.5, 0, 0},
  357. {-0.5, 0.4375, 0, 0.5, 0.5, 0.5},
  358. },
  359. },
  360. },
  361. ["_alt_2"] = {
  362. node_box = {
  363. type = "fixed",
  364. fixed = {
  365. {-0.5, -0.125, -0.5, 0.5, 0, 0},
  366. {-0.5, 0.375, 0, 0.5, 0.5, 0.5},
  367. },
  368. },
  369. },
  370. ["_alt_4"] = {
  371. node_box = {
  372. type = "fixed",
  373. fixed = {
  374. {-0.5, -0.25, -0.5, 0.5, 0, 0},
  375. {-0.5, 0.25, 0, 0.5, 0.5, 0.5},
  376. },
  377. },
  378. },
  379. },
  380. }
  381. for type,a in pairs(stairsplus.defs) do
  382. for name,b in pairs(stairsplus.defs[type]) do
  383. table.insert(stairsplus.shapes_list, { type .. "_", name })
  384. end
  385. end