bedroom.lua 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. local dye_table = dye.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. _doc_items_crafting = 'This is crafted in the Woodworking Station.',
  8. description = 'Bed with '..desc..' Blankets',
  9. drawtype = 'mesh',
  10. mesh = 'furniture_bed1.obj',
  11. tiles = {'furniture_bed1_wood.png', 'furniture_bed1_sheets.png'},
  12. overlay_tiles = {{name = '(furniture_bed1_sheets.png^[multiply:'..hex..')^furniture_bed1_mask.png', color = 'white'}},
  13. use_texture_alpha = 'opaque',
  14. paramtype = 'light',
  15. paramtype2 = 'colorfacedir',
  16. palette = 'furniture_stain_palette.png',
  17. selection_box = {
  18. type = 'fixed',
  19. fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
  20. {-.5, 0, 1.35, .5, .5, 1.5}}
  21. },
  22. collision_box = {
  23. type = 'fixed',
  24. fixed = {{-.5, -.5, -.5, .5, 0, 1.5},
  25. {-.5, 0, 1.35, .5, .5, 1.5}}
  26. },
  27. groups = {oddly_breakable_by_hand = 2, choppy=3, stainable=1},
  28. after_place_node = function(pos, placer, itemstack)
  29. if not epic.space_to_front(pos) then
  30. minetest.remove_node(pos)
  31. return itemstack
  32. end
  33. end,
  34. after_dig_node = function(pos, oldnode)
  35. epic.remove_front_node(pos, oldnode)
  36. end,
  37. on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
  38. beds.on_rightclick(pos, clicker)
  39. return itemstack
  40. end,
  41. on_rotate = function(pos, node)
  42. return false
  43. end,
  44. })
  45. end
  46. minetest.register_node('furniture:desk', {
  47. description = 'Desk',
  48. drawtype = 'mesh',
  49. mesh = 'furniture_desk.obj',
  50. tiles = {'furniture_desk.png'},
  51. paramtype = 'light',
  52. paramtype2 = 'colorfacedir',
  53. palette = 'furniture_stain_palette.png',
  54. selection_box = {
  55. type = 'fixed',
  56. fixed = {-.5, -.5, -.5, 1.5, .5, .5}
  57. },
  58. collision_box = {
  59. type = 'fixed',
  60. fixed = {-.5, -.5, -.5, 1.5, .5, .5}
  61. },
  62. groups = {oddly_breakable_by_hand = 2, choppy=3, stainable=1},
  63. })