init.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. -- Various home electronics
  2. local S = minetest.get_translator("homedecor_electronics")
  3. homedecor.register("speaker", {
  4. description = S("Large Stereo Speaker"),
  5. mesh="homedecor_speaker_large.obj",
  6. tiles = {
  7. "homedecor_speaker_sides.png",
  8. "homedecor_speaker_front.png"
  9. },
  10. groups = { snappy = 3 },
  11. sounds = default.node_sound_wood_defaults(),
  12. on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
  13. minetest.set_node(pos, {name = "homedecor:speaker_open", param2 = node.param2})
  14. end
  15. })
  16. homedecor.register("speaker_open", {
  17. description = S("Large Stereo Speaker, open front"),
  18. mesh="homedecor_speaker_large_open.obj",
  19. tiles = {
  20. "homedecor_speaker_sides.png",
  21. "homedecor_speaker_driver.png",
  22. "homedecor_speaker_open_front.png",
  23. { name = "homedecor_generic_metal.png", color = homedecor.color_black }
  24. },
  25. groups = { snappy = 3, not_in_creative_inventory=1 },
  26. sounds = default.node_sound_wood_defaults(),
  27. on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
  28. minetest.set_node(pos, {name = "homedecor:speaker", param2 = node.param2})
  29. end
  30. })
  31. local spk_cbox = {
  32. type = "fixed",
  33. fixed = { -3/16, -8/16, 1/16, 3/16, -2/16, 7/16 }
  34. }
  35. homedecor.register("speaker_small", {
  36. description = S("Small Surround Speaker"),
  37. mesh="homedecor_speaker_small.obj",
  38. tiles = {
  39. "homedecor_speaker_sides.png",
  40. "homedecor_speaker_front.png"
  41. },
  42. selection_box = spk_cbox,
  43. walkable = false,
  44. groups = { snappy = 3 },
  45. sounds = default.node_sound_wood_defaults(),
  46. })
  47. homedecor.register("stereo", {
  48. description = S("Stereo Receiver"),
  49. tiles = { 'homedecor_stereo_top.png',
  50. 'homedecor_stereo_bottom.png',
  51. 'homedecor_stereo_left.png^[transformFX',
  52. 'homedecor_stereo_left.png',
  53. 'homedecor_stereo_back.png',
  54. 'homedecor_stereo_front.png'},
  55. groups = { snappy = 3 },
  56. sounds = default.node_sound_wood_defaults(),
  57. })
  58. homedecor.register("projection_screen", {
  59. description = S("Projection Screen Material"),
  60. drawtype = 'signlike',
  61. tiles = { 'homedecor_projection_screen.png' },
  62. wield_image = 'homedecor_projection_screen_inv.png',
  63. inventory_image = 'homedecor_projection_screen_inv.png',
  64. walkable = false,
  65. groups = { snappy = 3 },
  66. sounds = default.node_sound_leaves_defaults(),
  67. paramtype2 = 'wallmounted',
  68. selection_box = {
  69. type = "wallmounted",
  70. --wall_side = = <default>
  71. },
  72. })
  73. homedecor.register("television", {
  74. description = S("Small CRT Television"),
  75. tiles = { 'homedecor_television_top.png',
  76. 'homedecor_television_bottom.png',
  77. 'homedecor_television_left.png^[transformFX',
  78. 'homedecor_television_left.png',
  79. 'homedecor_television_back.png',
  80. { name="homedecor_television_front_animated.png",
  81. animation={
  82. type="vertical_frames",
  83. aspect_w=16,
  84. aspect_h=16,
  85. length=80.0
  86. }
  87. }
  88. },
  89. light_source = default.LIGHT_MAX - 1,
  90. groups = { snappy = 3 },
  91. sounds = default.node_sound_wood_defaults(),
  92. })
  93. homedecor.register("dvd_vcr", {
  94. description = S("DVD and VCR"),
  95. tiles = {
  96. "homedecor_dvdvcr_top.png",
  97. "homedecor_dvdvcr_bottom.png",
  98. "homedecor_dvdvcr_sides.png",
  99. "homedecor_dvdvcr_sides.png^[transformFX",
  100. "homedecor_dvdvcr_back.png",
  101. "homedecor_dvdvcr_front.png",
  102. },
  103. inventory_image = "homedecor_dvdvcr_inv.png",
  104. node_box = {
  105. type = "fixed",
  106. fixed = {
  107. {-0.3125, -0.5, -0.25, 0.3125, -0.375, 0.1875},
  108. {-0.25, -0.5, -0.25, 0.25, -0.1875, 0.125},
  109. }
  110. },
  111. groups = { snappy = 3 },
  112. sounds = default.node_sound_wood_defaults(),
  113. })
  114. local tel_cbox = {
  115. type = "fixed",
  116. fixed = { -0.25, -0.5, -0.1875, 0.25, -0.21, 0.15 }
  117. }
  118. homedecor.register("telephone", {
  119. mesh = "homedecor_telephone.obj",
  120. tiles = {
  121. "homedecor_telephone_dial.png",
  122. "homedecor_telephone_base.png",
  123. "homedecor_telephone_handset.png",
  124. "homedecor_telephone_cord.png",
  125. },
  126. inventory_image = "homedecor_telephone_inv.png",
  127. description = S("Telephone"),
  128. groups = {snappy=3},
  129. selection_box = tel_cbox,
  130. walkable = false,
  131. sounds = default.node_sound_wood_defaults(),
  132. })
  133. -- crafting
  134. minetest.register_craftitem(":homedecor:vcr", {
  135. description = S("VCR"),
  136. inventory_image = "homedecor_vcr.png"
  137. })
  138. minetest.register_craftitem(":homedecor:dvd_player", {
  139. description = S("DVD Player"),
  140. inventory_image = "homedecor_dvd_player.png"
  141. })
  142. minetest.register_craftitem(":homedecor:speaker_driver", {
  143. description = S("Speaker driver"),
  144. inventory_image = "homedecor_speaker_driver_inv.png"
  145. })
  146. minetest.register_craft( {
  147. output = "homedecor:projection_screen 3",
  148. recipe = {
  149. { "", "default:glass", "" },
  150. { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
  151. { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
  152. },
  153. })
  154. minetest.register_craft({
  155. type = "fuel",
  156. recipe = "homedecor:projection_screen",
  157. burntime = 30,
  158. })
  159. minetest.register_craft( {
  160. output = "basic_materials:ic 4",
  161. recipe = {
  162. { "basic_materials:silicon", "basic_materials:silicon" },
  163. { "basic_materials:silicon", "default:copper_ingot" },
  164. },
  165. })
  166. minetest.register_craft( {
  167. output = "homedecor:television",
  168. recipe = {
  169. { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
  170. { "basic_materials:plastic_sheet", "moreblocks:glow_glass", "basic_materials:plastic_sheet" },
  171. { "basic_materials:ic", "basic_materials:ic", "basic_materials:ic" },
  172. },
  173. })
  174. minetest.register_craft( {
  175. output = "homedecor:television",
  176. recipe = {
  177. { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
  178. { "basic_materials:plastic_sheet", "default:glass", "basic_materials:plastic_sheet" },
  179. { "basic_materials:ic", "basic_materials:energy_crystal_simple", "basic_materials:ic" },
  180. },
  181. })
  182. minetest.register_craft( {
  183. output = "homedecor:stereo",
  184. recipe = {
  185. { "basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:plastic_sheet" },
  186. { "basic_materials:plastic_sheet", "basic_materials:ic", "basic_materials:plastic_sheet" },
  187. { "default:steel_ingot", "basic_materials:ic", "default:steel_ingot" },
  188. },
  189. })
  190. minetest.register_craft( {
  191. output = "homedecor:speaker_driver 2",
  192. recipe = {
  193. { "", "default:steel_ingot", "" },
  194. { "default:paper", "basic_materials:copper_wire", "default:iron_lump" },
  195. { "", "default:steel_ingot", "" },
  196. },
  197. })
  198. minetest.register_craft( {
  199. output = "homedecor:speaker_small",
  200. recipe = {
  201. { "wool:black", "homedecor:speaker_driver", "group:wood" },
  202. },
  203. })
  204. minetest.register_craft( {
  205. output = "homedecor:speaker",
  206. recipe = {
  207. { "wool:black", "homedecor:speaker_driver", "group:wood" },
  208. { "wool:black", "homedecor:speaker_driver", "group:wood" },
  209. { "wool:black", "group:wood", "group:wood" },
  210. },
  211. })
  212. -- cotton version
  213. minetest.register_craft( {
  214. output = "homedecor:speaker_small",
  215. recipe = {
  216. { "cotton:black", "homedecor:speaker_driver", "group:wood" },
  217. },
  218. })
  219. minetest.register_craft( {
  220. output = "homedecor:speaker",
  221. recipe = {
  222. { "cotton:black", "homedecor:speaker_driver", "group:wood" },
  223. { "cotton:black", "homedecor:speaker_driver", "group:wood" },
  224. { "cotton:black", "group:wood", "group:wood" },
  225. },
  226. })
  227. minetest.register_craft({
  228. output = "homedecor:vcr 2",
  229. recipe = {
  230. { "basic_materials:ic", "default:steel_ingot", "basic_materials:plastic_sheet" },
  231. { "default:iron_lump", "default:iron_lump", "default:iron_lump" },
  232. { "basic_materials:plastic_sheet", "", "basic_materials:plastic_sheet" },
  233. },
  234. })
  235. minetest.register_craft({
  236. output = "homedecor:dvd_player 2",
  237. recipe = {
  238. { "", "basic_materials:plastic_sheet", "" },
  239. { "default:obsidian_glass", "basic_materials:motor", "basic_materials:motor" },
  240. { "default:mese_crystal_fragment", "basic_materials:ic", "basic_materials:energy_crystal_simple" },
  241. },
  242. })
  243. minetest.register_craft({
  244. type = "shapeless",
  245. output = "homedecor:dvd_vcr",
  246. recipe = {
  247. "homedecor:vcr",
  248. "homedecor:dvd_player"
  249. },
  250. })
  251. minetest.register_craft( {
  252. output = "homedecor:telephone",
  253. recipe = {
  254. { "homedecor:speaker_driver", "basic_materials:copper_wire", "homedecor:speaker_driver" },
  255. { "basic_materials:plastic_sheet", "default:steel_ingot", "basic_materials:plastic_sheet" },
  256. { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }
  257. },
  258. })