init.lua 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. local S = minetest.get_translator("homedecor_furniture")
  2. local table_colors = {
  3. { "", S("Table"), homedecor.plain_wood },
  4. { "_mahogany", S("Mahogany Table"), homedecor.mahogany_wood },
  5. { "_white", S("White Table"), homedecor.white_wood }
  6. }
  7. for _, t in ipairs(table_colors) do
  8. local suffix, desc, texture = unpack(t)
  9. homedecor.register("table"..suffix, {
  10. description = desc,
  11. tiles = { texture },
  12. node_box = {
  13. type = "fixed",
  14. fixed = {
  15. { -0.4, -0.5, -0.4, -0.3, 0.4, -0.3 },
  16. { 0.3, -0.5, -0.4, 0.4, 0.4, -0.3 },
  17. { -0.4, -0.5, 0.3, -0.3, 0.4, 0.4 },
  18. { 0.3, -0.5, 0.3, 0.4, 0.4, 0.4 },
  19. { -0.5, 0.4, -0.5, 0.5, 0.5, 0.5 },
  20. { -0.4, -0.2, -0.3, -0.3, -0.1, 0.3 },
  21. { 0.3, -0.2, -0.4, 0.4, -0.1, 0.3 },
  22. { -0.3, -0.2, -0.4, 0.4, -0.1, -0.3 },
  23. { -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
  24. },
  25. },
  26. groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
  27. sounds = default.node_sound_wood_defaults(),
  28. })
  29. end
  30. local ob_cbox = {
  31. type = "fixed",
  32. fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
  33. }
  34. minetest.register_node(":homedecor:openframe_bookshelf", {
  35. description = S("Bookshelf (open-frame)"),
  36. drawtype = "mesh",
  37. mesh = "homedecor_openframe_bookshelf.obj",
  38. tiles = {
  39. "homedecor_openframe_bookshelf_books.png",
  40. "default_wood.png"
  41. },
  42. groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
  43. sounds = default.node_sound_wood_defaults(),
  44. paramtype = "light",
  45. paramtype2 = "facedir",
  46. selection_box = ob_cbox,
  47. collision_box = ob_cbox,
  48. })
  49. homedecor.register("wall_shelf", {
  50. description = S("Wall Shelf"),
  51. tiles = {
  52. "default_wood.png",
  53. },
  54. groups = { snappy = 3 },
  55. sounds = default.node_sound_wood_defaults(),
  56. node_box = {
  57. type = "fixed",
  58. fixed = {
  59. {-0.5, 0.4, 0.47, 0.5, 0.47, 0.5},
  60. {-0.5, 0.47, -0.1875, 0.5, 0.5, 0.5}
  61. }
  62. }
  63. })
  64. -- Crafts
  65. minetest.register_craft({
  66. output = "homedecor:table",
  67. recipe = {
  68. { "group:wood","group:wood", "group:wood" },
  69. { "group:stick", "", "group:stick" },
  70. },
  71. })
  72. minetest.register_craft({
  73. type = "shapeless",
  74. output = "homedecor:table_mahogany",
  75. recipe = {
  76. "homedecor:table",
  77. "dye:brown",
  78. },
  79. })
  80. minetest.register_craft({
  81. type = "shapeless",
  82. output = "homedecor:table_mahogany",
  83. recipe = {
  84. "homedecor:table",
  85. "unifieddyes:dark_orange",
  86. },
  87. })
  88. minetest.register_craft({
  89. type = "shapeless",
  90. output = "homedecor:table_white",
  91. recipe = {
  92. "homedecor:table",
  93. "dye:white",
  94. },
  95. })
  96. minetest.register_craft({
  97. type = "fuel",
  98. recipe = "homedecor:table",
  99. burntime = 30,
  100. })
  101. minetest.register_craft({
  102. type = "fuel",
  103. recipe = "homedecor:table_mahogany",
  104. burntime = 30,
  105. })
  106. minetest.register_craft({
  107. type = "fuel",
  108. recipe = "homedecor:table_white",
  109. burntime = 30,
  110. })
  111. minetest.register_craft({
  112. output = "homedecor:standing_lamp_off",
  113. recipe = {
  114. {"homedecor:table_lamp_off"},
  115. {"group:stick"},
  116. {"group:stick"},
  117. },
  118. })
  119. unifieddyes.register_color_craft({
  120. output = "homedecor:standing_lamp_off",
  121. palette = "extended",
  122. type = "shapeless",
  123. neutral_node = "homedecor:standing_lamp_off",
  124. recipe = {
  125. "NEUTRAL_NODE",
  126. "MAIN_DYE"
  127. }
  128. })
  129. minetest.register_craft({
  130. type = "fuel",
  131. recipe = "homedecor:table_lamp_off",
  132. burntime = 10,
  133. })
  134. minetest.register_craft({
  135. output = "homedecor:table_lamp_off",
  136. recipe = {
  137. { "wool:white", "default:torch", "wool:white"},
  138. { "", "group:stick", ""},
  139. { "", "stairs:slab_wood", "" },
  140. },
  141. })
  142. minetest.register_craft({
  143. output = "homedecor:table_lamp_off",
  144. recipe = {
  145. { "cottages:wool", "default:torch", "cottages:wool"},
  146. { "", "group:stick", ""},
  147. { "", "stairs:slab_wood", "" },
  148. },
  149. })
  150. minetest.register_craft({
  151. output = "homedecor:table_lamp_off",
  152. recipe = {
  153. { "wool:white", "default:torch", "wool:white"},
  154. { "", "group:stick", ""},
  155. { "", "moreblocks:slab_wood", "" },
  156. },
  157. })
  158. minetest.register_craft({
  159. output = "homedecor:table_lamp_off",
  160. recipe = {
  161. { "cottages:wool", "default:torch", "cottages:wool"},
  162. { "", "group:stick", ""},
  163. { "", "moreblocks:slab_wood", "" },
  164. },
  165. })
  166. unifieddyes.register_color_craft({
  167. output = "homedecor:table_lamp_off",
  168. palette = "extended",
  169. type = "shapeless",
  170. neutral_node = "homedecor:table_lamp_off",
  171. recipe = {
  172. "NEUTRAL_NODE",
  173. "MAIN_DYE"
  174. }
  175. })
  176. minetest.register_craft({
  177. output = "homedecor:toilet",
  178. recipe = {
  179. { "","","bucket:bucket_water"},
  180. { "group:marble","group:marble", "group:marble" },
  181. { "", "bucket:bucket_empty", "" },
  182. },
  183. })
  184. minetest.register_craft({
  185. output = "homedecor:sink",
  186. recipe = {
  187. { "group:marble","bucket:bucket_empty", "group:marble" },
  188. { "", "group:marble", "" }
  189. },
  190. })
  191. minetest.register_craft({
  192. output = "homedecor:taps",
  193. recipe = {
  194. { "default:steel_ingot","bucket:bucket_water", "default:steel_ingot" },
  195. },
  196. })
  197. minetest.register_craft({
  198. output = "homedecor:taps_brass",
  199. recipe = {
  200. { "technic:brass_ingot","bucket:bucket_water", "technic:brass_ingot" },
  201. },
  202. })
  203. minetest.register_craft({
  204. output = "homedecor:shower_tray",
  205. recipe = {
  206. { "group:marble","bucket:bucket_empty", "group:marble" },
  207. },
  208. })
  209. minetest.register_craft({
  210. output = "homedecor:shower_head",
  211. recipe = {
  212. {"default:steel_ingot", "bucket:bucket_water"},
  213. },
  214. })
  215. minetest.register_craft({
  216. output = "homedecor:bathtub_clawfoot_brass_taps",
  217. recipe = {
  218. { "homedecor:taps_brass", "", "" },
  219. { "group:marble", "", "group:marble" },
  220. {"default:steel_ingot", "group:marble", "default:steel_ingot"},
  221. },
  222. })
  223. minetest.register_craft({
  224. output = "homedecor:bathtub_clawfoot_chrome_taps",
  225. recipe = {
  226. { "homedecor:taps", "", "" },
  227. { "group:marble", "", "group:marble" },
  228. {"default:steel_ingot", "group:marble", "default:steel_ingot"},
  229. },
  230. })
  231. minetest.register_craft({
  232. output = "homedecor:bars 6",
  233. recipe = {
  234. { "default:steel_ingot","default:steel_ingot","default:steel_ingot" },
  235. { "homedecor:pole_wrought_iron","homedecor:pole_wrought_iron","homedecor:pole_wrought_iron" },
  236. },
  237. })
  238. minetest.register_craft({
  239. output = "homedecor:L_binding_bars 3",
  240. recipe = {
  241. { "homedecor:bars","" },
  242. { "homedecor:bars","homedecor:bars" },
  243. },
  244. })
  245. minetest.register_craft({
  246. output = "homedecor:torch_wall 10",
  247. recipe = {
  248. { "default:coal_lump" },
  249. { "default:steel_ingot" },
  250. },
  251. })
  252. -- Aliases for 3dforniture mod.
  253. minetest.register_alias("3dforniture:table", "homedecor:table")
  254. minetest.register_alias('table', 'homedecor:table')