seating.lua 10 KB

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