bedroom.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. local dye_table = furniture.dyes
  2. for i in ipairs(dye_table) do
  3. local name = dye_table[i][1]
  4. local desc = dye_table[i][2]
  5. local hex = dye_table[i][3]
  6. minetest.register_node('furniture:bed1_'..name, {
  7. description = 'Bed with '..desc..' Blankets',
  8. drawtype = 'mesh',
  9. mesh = 'furniture_bed1.obj',
  10. tiles = {'furniture_bed1_wood.png', 'furniture_bed1_sheets.png'},
  11. overlay_tiles = {{name = '(furniture_bed1_sheets.png^[multiply:'..hex..')^furniture_bed1_mask.png', color = 'white'}},
  12. use_texture_alpha = 'clip',
  13. paramtype = 'light',
  14. paramtype2 = 'colorfacedir',
  15. palette = 'furniture_stain_palette.png',
  16. selection_box = {
  17. type = 'fixed',
  18. fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
  19. {-.5, 0, 1.35, .5, .5, 1.5}}
  20. },
  21. collision_box = {
  22. type = 'fixed',
  23. fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
  24. {-.5, 0, 1.35, .5, .5, 1.5}}
  25. },
  26. groups = {breakable=1},
  27. on_rightclick = furniture.right_click,
  28. on_punch = furniture.punch
  29. })
  30. minetest.register_node('furniture:bed_double1_'..name, {
  31. description = 'Double Bed with '..desc..' Blankets',
  32. drawtype = 'mesh',
  33. mesh = 'furniture_bed_double1.obj',
  34. tiles = {'furniture_bed_double1_wood.png', 'furniture_bed_double1_sheets.png'},
  35. overlay_tiles = {{name = '(furniture_bed_double1_sheets.png^[multiply:'..hex..')^furniture_bed_double1_mask.png', color = 'white'}},
  36. use_texture_alpha = 'clip',
  37. paramtype = 'light',
  38. paramtype2 = 'colorfacedir',
  39. palette = 'furniture_stain_palette.png',
  40. selection_box = {
  41. type = 'fixed',
  42. fixed = {{-.5, -.5, -.5, 1.5, 0, 1.5},
  43. {-.5, 0, 1.35, 1.5, .5, 1.5}}
  44. },
  45. collision_box = {
  46. type = 'fixed',
  47. fixed = {{-.5, -.5, -.5, 1.5, 0, 1.5},
  48. {-.5, 0, 1.35, 1.5, .5, 1.5}}
  49. },
  50. groups = {breakable=1},
  51. on_rightclick = furniture.right_click,
  52. on_punch = furniture.punch
  53. })
  54. end
  55. minetest.register_node('furniture:sleeping_mat', {
  56. description = 'Sleeping Mat',
  57. drawtype = 'mesh',
  58. mesh = 'furniture_sleeping_mat.obj',
  59. tiles = {'furniture_sleeping_mat.png'},
  60. paramtype = 'light',
  61. paramtype2 = 'facedir',
  62. selection_box = {
  63. type = 'fixed',
  64. fixed = {-.5, -.5, -.5, .5, -.25, 1.5},
  65. },
  66. collision_box = {
  67. type = 'fixed',
  68. fixed = {-.5, -.5, -.5, .5, -.25, 1.5},
  69. },
  70. groups = {breakable=1}
  71. })
  72. minetest.register_node('furniture:nightstand_1', {
  73. description = 'Nightstand',
  74. drawtype = 'mesh',
  75. mesh = 'furniture_nightstand_1.obj',
  76. tiles = {'furniture_nightstand_1.png'},
  77. paramtype = 'light',
  78. paramtype2 = 'colorfacedir',
  79. palette = 'furniture_stain_palette.png',
  80. selection_box = {
  81. type = 'fixed',
  82. fixed = {-.5, -.5, -.25, .5, .5, .5},
  83. },
  84. collision_box = {
  85. type = 'fixed',
  86. fixed = {-.5, -.5, -.25, .5, .5, .5},
  87. },
  88. groups = {breakable=1, stash=1},
  89. on_rightclick = furniture.right_click,
  90. on_punch = furniture.punch
  91. })
  92. minetest.register_node('furniture:dresser1_wide', {
  93. description = 'Wide Dresser',
  94. drawtype = 'mesh',
  95. mesh = 'furniture_dresser1_wide.obj',
  96. tiles = {'furniture_dresser1_wide.png'},
  97. paramtype = 'light',
  98. paramtype2 = 'colorfacedir',
  99. palette = 'furniture_stain_palette.png',
  100. selection_box = {
  101. type = 'fixed',
  102. fixed = {-.5, -.5, -.375, 1.5, .5, .5},
  103. },
  104. collision_box = {
  105. type = 'fixed',
  106. fixed = {-.5, -.5, -.375, 1.5, .5, .5},
  107. },
  108. groups = {breakable=1, stash=1},
  109. on_rightclick = furniture.right_click,
  110. on_punch = furniture.punch
  111. })
  112. minetest.register_node('furniture:dresser1_tall', {
  113. description = 'Tall Dresser',
  114. drawtype = 'mesh',
  115. mesh = 'furniture_dresser1_tall.obj',
  116. tiles = {'furniture_dresser1_tall.png'},
  117. paramtype = 'light',
  118. paramtype2 = 'colorfacedir',
  119. palette = 'furniture_stain_palette.png',
  120. selection_box = {
  121. type = 'fixed',
  122. fixed = {-.5, -.5, -.375, .5, 1.5, .5},
  123. },
  124. collision_box = {
  125. type = 'fixed',
  126. fixed = {-.5, -.5, -.375, .5, 1.5, .5},
  127. },
  128. groups = {breakable=1, stash=1},
  129. on_rightclick = furniture.right_click,
  130. on_punch = furniture.punch
  131. })