seating.lua 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. minetest.register_node('furniture:stool_short', {
  2. description = 'Short stool',
  3. drawtype = 'mesh',
  4. mesh = 'furniture_stool_short.obj',
  5. tiles = {'furniture_stool_short.png'},
  6. paramtype = 'light',
  7. paramtype2 = 'colorfacedir',
  8. palette = 'furniture_stain_palette.png',
  9. selection_box = {
  10. type = 'fixed',
  11. fixed = {-.375, -.5, -.375, .375, 0, .375},
  12. },
  13. collision_box = {
  14. type = 'fixed',
  15. fixed = {-.375, -.5, -.375, .375, 0, .375},
  16. },
  17. groups = {breakable=1},
  18. on_rightclick = furniture.right_click,
  19. on_punch = furniture.punch
  20. })
  21. minetest.register_node('furniture:stool_tall', {
  22. description = 'Tall stool',
  23. drawtype = 'mesh',
  24. mesh = 'furniture_stool_tall.obj',
  25. tiles = {'furniture_stool_tall.png'},
  26. paramtype = 'light',
  27. paramtype2 = 'colorfacedir',
  28. palette = 'furniture_stain_palette.png',
  29. selection_box = {
  30. type = 'fixed',
  31. fixed = {-.375, -.5, -.375, .375, .5, .375},
  32. },
  33. collision_box = {
  34. type = 'fixed',
  35. fixed = {-.375, -.5, -.375, .375, .5, .375},
  36. },
  37. groups = {breakable=1},
  38. on_rightclick = furniture.right_click,
  39. on_punch = furniture.punch
  40. })
  41. minetest.register_node('furniture:chair', {
  42. description = 'Chair',
  43. drawtype = 'mesh',
  44. mesh = 'furniture_chair.obj',
  45. tiles = {'furniture_chair.png'},
  46. paramtype = 'light',
  47. paramtype2 = 'colorfacedir',
  48. palette = 'furniture_stain_palette.png',
  49. selection_box = {
  50. type = 'fixed',
  51. fixed = {-.375, -.5, -.375, .375, 0, .375},
  52. },
  53. collision_box = {
  54. type = 'fixed',
  55. fixed = {-.375, -.5, -.375, .375, 0, .375},
  56. },
  57. groups = {breakable=1},
  58. on_rightclick = furniture.right_click,
  59. on_punch = furniture.punch
  60. })
  61. minetest.register_node('furniture:bench', {
  62. description = 'Bench',
  63. drawtype = 'mesh',
  64. mesh = 'furniture_bench.obj',
  65. tiles = {'furniture_bench.png'},
  66. paramtype = 'light',
  67. paramtype2 = 'colorfacedir',
  68. palette = 'furniture_stain_palette.png',
  69. selection_box = {
  70. type = 'fixed',
  71. fixed = {-.375, -.5, -.375, 1.375, 0, .375},
  72. },
  73. collision_box = {
  74. type = 'fixed',
  75. fixed = {-.375, -.5, -.375, 1.375, 0, .375},
  76. },
  77. groups = {breakable=1},
  78. on_rightclick = furniture.right_click,
  79. on_punch = furniture.punch
  80. })
  81. minetest.register_node('furniture:bench_with_back', {
  82. description = 'Bench with Back',
  83. drawtype = 'mesh',
  84. mesh = 'furniture_bench_with_back.obj',
  85. tiles = {'furniture_bench_with_back.png'},
  86. paramtype = 'light',
  87. paramtype2 = 'colorfacedir',
  88. palette = 'furniture_stain_palette.png',
  89. selection_box = {
  90. type = 'fixed',
  91. fixed = {{-.375, -.5, -.375, .5, 0, .45}, --seat
  92. {-.375, 0, .275, 1.375, .5, .375}} --back
  93. },
  94. collision_box = {
  95. type = 'fixed',
  96. fixed = {{-.375, -.5, -.375, 1.375, 0, .45},
  97. {-.375, 0, .275, 1.375, .5, .375}}
  98. },
  99. groups = {breakable=1},
  100. on_rightclick = furniture.right_click,
  101. on_punch = furniture.punch
  102. })
  103. minetest.register_node('furniture:bench_picnic', {
  104. description = 'Picnic Table',
  105. drawtype = 'mesh',
  106. mesh = 'furniture_bench_picnic.obj',
  107. tiles = {'furniture_bench_picnic.png'},
  108. paramtype = 'light',
  109. paramtype2 = 'colorfacedir',
  110. palette = 'furniture_stain_palette.png',
  111. selection_box = {
  112. type = 'fixed',
  113. fixed = {
  114. {-.375, -.5, -.375, 1.375, 0, 1.375},
  115. {-.375, 0, -.0625, 1.375, .5, 1.0625}
  116. }
  117. },
  118. collision_box = {
  119. type = 'fixed',
  120. fixed = {
  121. {-.375, -.5, -.375, 1.375, 0, 1.375},
  122. {-.375, 0, -.0625, 1.375, .5, 1.0625}
  123. }
  124. },
  125. groups = {breakable=1},
  126. on_rightclick = furniture.right_click,
  127. on_punch = furniture.punch
  128. })
  129. minetest.register_node('furniture:stool_2', {
  130. description = 'Short stool',
  131. drawtype = 'mesh',
  132. mesh = 'furniture_stool_2.obj',
  133. tiles = {'furniture_stool_2.png'},
  134. paramtype = 'light',
  135. paramtype2 = 'facedir',
  136. selection_box = {
  137. type = 'fixed',
  138. fixed = {-.25, -.5, -.25, .25, .0625, .25},
  139. },
  140. collision_box = {
  141. type = 'fixed',
  142. fixed = {-.25, -.5, -.25, .25, .0625, .25},
  143. },
  144. groups = {breakable=1},
  145. })
  146. ---Cushioned items. Yay. :P
  147. local dye_table = furniture.dyes
  148. for i in ipairs(dye_table) do
  149. local name = dye_table[i][1]
  150. local desc = dye_table[i][2]
  151. local hex = dye_table[i][3]
  152. minetest.register_node('furniture:stool_short_'..name, {
  153. description = 'Short Stool with '..desc..' Cushion',
  154. drawtype = 'mesh',
  155. mesh = 'furniture_stool_short_cushion.obj',
  156. tiles = {'furniture_stool_short.png', 'furniture_cushion_pad.png'},
  157. overlay_tiles = {'', {name = 'furniture_cushion_pad.png', color = hex}},
  158. paramtype = 'light',
  159. paramtype2 = 'colorfacedir',
  160. palette = 'furniture_stain_palette.png',
  161. selection_box = {
  162. type = 'fixed',
  163. fixed = {-.375, -.5, -.375, .375, 0, .375},
  164. },
  165. collision_box = {
  166. type = 'fixed',
  167. fixed = {-.375, -.5, -.375, .375, 0, .375},
  168. },
  169. groups = {breakable=1},
  170. on_rightclick = furniture.right_click,
  171. on_punch = furniture.punch
  172. })
  173. minetest.register_node('furniture:stool_tall_'..name, {
  174. description = 'Tall Stool with '..desc..' Cushion',
  175. drawtype = 'mesh',
  176. mesh = 'furniture_stool_tall_cushion.obj',
  177. tiles = {'furniture_stool_tall.png', 'furniture_cushion_pad.png'},
  178. overlay_tiles = {'', {name = 'furniture_cushion_pad.png', color = hex}},
  179. paramtype = 'light',
  180. paramtype2 = 'colorfacedir',
  181. palette = 'furniture_stain_palette.png',
  182. selection_box = {
  183. type = 'fixed',
  184. fixed = {-.375, -.5, -.375, .375, .5, .375},
  185. },
  186. collision_box = {
  187. type = 'fixed',
  188. fixed = {-.375, -.5, -.375, .375, .5, .375},
  189. },
  190. groups = {breakable=1},
  191. on_rightclick = furniture.right_click,
  192. on_punch = furniture.punch
  193. })
  194. minetest.register_node('furniture:chair_'..name, {
  195. description = 'Chair with '..desc..' Cushion',
  196. drawtype = 'mesh',
  197. mesh = 'furniture_chair_cushion.obj',
  198. tiles = {'furniture_chair.png', 'furniture_cushion_pad.png'},
  199. overlay_tiles = {'', {name = 'furniture_cushion_pad.png', color = hex}},
  200. paramtype = 'light',
  201. paramtype2 = 'colorfacedir',
  202. palette = 'furniture_stain_palette.png',
  203. selection_box = {
  204. type = 'fixed',
  205. fixed = {-.375, -.5, -.375, .375, 0, .375},
  206. },
  207. collision_box = {
  208. type = 'fixed',
  209. fixed = {-.375, -.5, -.375, .375, 0, .375},
  210. },
  211. groups = {breakable=1},
  212. on_rightclick = furniture.right_click,
  213. on_punch = furniture.punch
  214. })
  215. minetest.register_node('furniture:chair_waitingroom_'..name, {
  216. description = 'Modern Chair with '..desc..' Cushion',
  217. drawtype = 'mesh',
  218. mesh = 'furniture_chair_waitingroom.obj',
  219. tiles = {'furniture_chair_waitingroom_frame.png', 'furniture_chair_waitingroom_cushion.png'},
  220. overlay_tiles = {'', {name = 'furniture_chair_waitingroom_cushion.png', color = hex}},
  221. paramtype = 'light',
  222. paramtype2 = 'colorfacedir',
  223. palette = 'furniture_frame_palette.png',
  224. selection_box = {
  225. type = 'fixed',
  226. fixed = {
  227. {-.375, -.5, -.375, .375, 0, .4375},
  228. {-.375, 0, .3125, .375, .5, .4375}
  229. }
  230. },
  231. collision_box = {
  232. type = 'fixed',
  233. fixed = {
  234. {-.375, -.5, -.375, .375, 0, .375},
  235. {-.375, 0, .375, .375, .5, .5}
  236. }
  237. },
  238. groups = {breakable=1},
  239. on_rightclick = furniture.right_click,
  240. on_punch = furniture.punch
  241. })
  242. minetest.register_node('furniture:Sofa_'..name, {--collision_box needs fixing, only half size
  243. description = desc..' Sofa',
  244. drawtype = 'mesh',
  245. mesh = 'furniture_sofa.obj',
  246. tiles = {'furniture_sofa.png^[multiply:'..hex},
  247. paramtype = 'light',
  248. paramtype2 = 'colorfacedir',
  249. palette = 'furniture_frame_palette.png',
  250. selection_box = {
  251. type = 'fixed',
  252. fixed = {
  253. {-.375, -.5, -.375, 1.375, 0, .4375},
  254. {-.375, -.4375, .3125, 1.375, .4375, .5}
  255. }
  256. },
  257. collision_box = {
  258. type = 'fixed',
  259. fixed = {
  260. {-.375, -.5, -.375, .375, 0, .375},
  261. {-.375, 0, .375, .375, .5, .5}
  262. }
  263. },
  264. groups = {breakable=1},
  265. on_rightclick = furniture.right_click,
  266. on_punch = furniture.punch
  267. })
  268. minetest.register_node('furniture:cushion_half_'..name, {
  269. description = desc..' Half Cushion',
  270. drawtype = 'nodebox',
  271. tiles = {'furniture_cushion.png^[multiply:'..hex},
  272. paramtype = 'light',
  273. node_box = {
  274. type = 'fixed',
  275. fixed = {-.5, -.5, -.5, .5, 0, .5},
  276. },
  277. groups = {breakable=1, bouncy=25, fall_damage_add_percent=-25},
  278. })
  279. minetest.register_node('furniture:cushion_full_'..name, {
  280. description = desc..' Full Cushion',
  281. tiles = {'furniture_cushion.png^[multiply:'..hex},
  282. groups = {breakable=1, bouncy=50, fall_damage_add_percent=-50},
  283. })
  284. end