beds.lua 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. -- Fancy shaped bed
  2. beds.nodebox = {
  3. bottom = {
  4. {-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
  5. {0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
  6. {-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
  7. {-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
  8. {0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
  9. {-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
  10. },
  11. top = {
  12. {-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
  13. {0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
  14. {-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
  15. {-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5},
  16. {-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
  17. {0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
  18. {-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
  19. }
  20. }
  21. beds.nodebox_simple = {
  22. bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
  23. top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
  24. }
  25. beds.selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}
  26. beds.bed_colors = {
  27. {name="red", desc="Red", wool="red", mask="#cb1919"},
  28. {name="brown", desc="Brown", wool="brown", mask="#703a00"},
  29. {name="black", desc="Black", wool="black", mask="#2b2b2b"},
  30. {name="yellow", desc="Yellow", wool="yellow", mask="#fcff11"},
  31. {name="green", desc="Green", wool="green", mask="#73ff1c"},
  32. {name="pink", desc="Pink", wool="pink", mask="#ffa6a6"},
  33. {name="orange", desc="Orange", wool="orange", mask="#e96b1e"},
  34. {name="violet", desc="Violet", wool="violet", mask="#670cb4"},
  35. {name="magenta", desc="Magenta", wool="magenta", mask="#e50590"},
  36. {name="dark_green", desc="Dark Green", wool="dark_green", mask="#2c7f00"},
  37. {name="cyan", desc="Cyan", wool="cyan", mask="#00a3ab"},
  38. {name="blue", desc="Blue", wool="blue", mask="#0059a7"},
  39. {name="dark_grey", desc="Dark Gray", wool="dark_grey", mask="#4c4c4c"},
  40. {name="grey", desc="Gray", wool="grey", mask="#a2a2a2"},
  41. {name="white", desc="Silver", wool="white", mask="#f3f3f3"},
  42. }
  43. for k, v in ipairs(beds.bed_colors) do
  44. local name = v.name
  45. local desc = v.desc
  46. local wool = v.wool
  47. local mask = v.mask
  48. beds.register_bed("beds:fancy_bed_" .. name, {
  49. description = "Fancy Bed (" .. desc .. ")\n\nSleep once to set or refresh your home position.\nHold 'E' when placing to make public.",
  50. inventory_image = "beds_bed_fancy.png^(beds_bed_fancy_mask.png^[multiply:" .. mask .. ")",
  51. wield_image = "beds_bed_fancy.png^(beds_bed_fancy_mask.png^[multiply:" .. mask .. ")",
  52. tiles = {
  53. bottom = {
  54. "beds_bed_top1.png^(beds_bed_top1_mask.png^[multiply:" .. mask .. ")",
  55. "default_wood.png",
  56. "beds_bed_side1.png^(beds_bed_side1_mask.png^[multiply:" .. mask .. ")",
  57. "(beds_bed_side1.png^[transformFX)^((beds_bed_side1_mask.png^[multiply:" .. mask .. ")^[transformFX)",
  58. "default_wood.png",
  59. "beds_bed_foot.png^(beds_bed_foot_mask.png^[multiply:" .. mask .. ")",
  60. },
  61. top = {
  62. "beds_bed_top2.png^(beds_bed_top2_mask.png^[multiply:" .. mask .. ")",
  63. "default_wood.png",
  64. "beds_bed_side2.png^(beds_bed_side2_mask.png^[multiply:" .. mask .. ")",
  65. "(beds_bed_side2.png^[transformFX)^((beds_bed_side2_mask.png^[multiply:" .. mask .. ")^[transformFX)",
  66. "beds_bed_head.png",
  67. "default_wood.png",
  68. }
  69. },
  70. nodebox = beds.nodebox,
  71. selectionbox = beds.selectionbox,
  72. recipe = {
  73. {"", "", "group:stick"},
  74. {"wool:" .. wool, "wool:" .. wool, "wool:white"},
  75. {"group:wood", "group:wood", "group:wood"},
  76. },
  77. })
  78. -- Simple shaped bed
  79. beds.register_bed("beds:bed_" .. name, {
  80. description = "Simple Bed (" .. desc .. ")\n\nSleep once to set or refresh your home position.\nHold 'E' when placing to make public.",
  81. inventory_image = "beds_bed.png^(beds_bed_mask.png^[multiply:" .. mask .. ")",
  82. wield_image = "beds_bed.png^(beds_bed_mask.png^[multiply:" .. mask .. ")",
  83. tiles = {
  84. bottom = {
  85. "(beds_bed_top_bottom.png^[transformR90)^((beds_bed_top_bottom_mask.png^[multiply:" .. mask .. ")^[transformR90)",
  86. "default_wood.png",
  87. "beds_bed_side_bottom_r.png^(beds_bed_side_bottom_r_mask.png^[multiply:" .. mask .. ")",
  88. "(beds_bed_side_bottom_r.png^[transformfx)^((beds_bed_side_bottom_r_mask.png^[multiply:" .. mask .. ")^[transformfx)",
  89. "beds_transparent.png",
  90. "beds_bed_side_bottom.png^(beds_bed_side_bottom_mask.png^[multiply:" .. mask .. ")",
  91. },
  92. top = {
  93. "(beds_bed_top_top.png^[transformR90)^((beds_bed_top_top_mask.png^[multiply:" .. mask .. ")^[transformR90)",
  94. "default_wood.png",
  95. "beds_bed_side_top_r.png^(beds_bed_side_top_r_mask.png^[multiply:" .. mask .. ")",
  96. "(beds_bed_side_top_r.png^[transformfx)^((beds_bed_side_top_r_mask.png^[multiply:" .. mask .. ")^[transformfx)",
  97. "beds_bed_side_top.png",
  98. "beds_transparent.png",
  99. }
  100. },
  101. nodebox = beds.nodebox_simple,
  102. selectionbox = beds.selectionbox,
  103. recipe = {
  104. {"wool:" .. wool, "wool:" .. wool, "wool:white"},
  105. {"group:wood", "group:wood", "group:wood"},
  106. },
  107. })
  108. end
  109. minetest.register_alias("beds:fancy_bed_bottom", "beds:fancy_bed_red_bottom")
  110. minetest.register_alias("beds:fancy_bed_top", "beds:fancy_bed_red_top")
  111. -- Aliases for PilzAdam's beds mod
  112. minetest.register_alias("beds:bed_bottom", "beds:bed_red_bottom")
  113. minetest.register_alias("beds:bed_top", "beds:bed_red_top")