Minetest mod that adds scifi themed nodes https://content.minetest.net/packages/D00Med/scifi_nodes/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1215 lines
35 KiB

  1. -- GENERATED CODE
  2. -- Node Box Editor, version 0.9.0
  3. local position1 = nil
  4. local position2 = nil
  5. minetest.register_node("scifi_nodes:alienslope", {
  6. description = "Alien Platform",
  7. tiles = {
  8. "scifi_nodes_alnslp_top2.png",
  9. "scifi_nodes_alnslp_top.png",
  10. "scifi_nodes_alnslp.png",
  11. "scifi_nodes_alnslp.png",
  12. "scifi_nodes_alnslp_top.png",
  13. "scifi_nodes_alnslp_top.png"
  14. },
  15. drawtype = "nodebox",
  16. paramtype = "light",
  17. paramtype2 = "facedir",
  18. groups = {cracky=1},
  19. node_box = {
  20. type = "fixed",
  21. fixed = {
  22. {0, -0.5, -0.5, 0.5, 0.5, 0.5}, -- NodeBox10
  23. {-0.5, -0.5, -0.5, 0, -0.25, 0.5}, -- NodeBox11
  24. {-0.4375, -0.25, -0.5, 0, -0.125, 0.5}, -- NodeBox12
  25. {-0.375, -0.125, -0.5, 0, 0, 0.5}, -- NodeBox13
  26. {-0.3125, 0, -0.5, 0, 0.125, 0.5}, -- NodeBox14
  27. {-0.25, 0.125, -0.5, 0, 0.25, 0.5}, -- NodeBox15
  28. {-0.1875, 0.25, -0.5, 0.0625, 0.375, 0.5}, -- NodeBox16
  29. {-0.125, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox17
  30. }
  31. },
  32. sounds = default.node_sound_wood_defaults(),
  33. on_place = minetest.rotate_node
  34. })
  35. minetest.register_node("scifi_nodes:wallpipe", {
  36. description = "Alien wall pipe",
  37. tiles = {
  38. "scifi_nodes_wallpipe.png",
  39. "scifi_nodes_wallpipe.png",
  40. "scifi_nodes_wallpipe.png",
  41. "scifi_nodes_wallpipe.png",
  42. "scifi_nodes_wallpipe.png",
  43. "scifi_nodes_wallpipe.png"
  44. },
  45. drawtype = "nodebox",
  46. paramtype = "light",
  47. paramtype2 = "facedir",
  48. groups = {cracky=1},
  49. node_box = {
  50. type = "fixed",
  51. fixed = {
  52. {-0.5, -0.5, 0.125, 0.5, 0.5, 0.5}, -- NodeBox18
  53. {-0.1875, -0.5, -0.0625, 0.1875, 0.5, 0.125}, -- NodeBox19
  54. {-0.125, -0.5, -0.125, 0.125, 0.5, 0.125}, -- NodeBox20
  55. {0.3125, -0.5, 0.0625, 0.4375, 0.5, 0.125}, -- NodeBox21
  56. {-0.4375, -0.5, 0.0625, -0.3125, 0.5, 0.125}, -- NodeBox22
  57. {-0.5, 0.0625, 0, 0.5, 0.1875, 0.0625}, -- NodeBox23
  58. {-0.5, -0.125, 0, 0.5, 0, 0.0625}, -- NodeBox24
  59. }
  60. },
  61. sounds = default.node_sound_wood_defaults()
  62. })
  63. minetest.register_node("scifi_nodes:plant_trap", {
  64. description = "Hanging Trap Plant",
  65. tiles = {
  66. "scifi_nodes_traplant_top.png",
  67. "scifi_nodes_traplant_side.png",
  68. "scifi_nodes_traplant_side.png",
  69. "scifi_nodes_traplant_side.png",
  70. "scifi_nodes_traplant_side.png",
  71. "scifi_nodes_traplant_side.png"
  72. },
  73. drawtype = "nodebox",
  74. paramtype = "light",
  75. paramtype2 = "facedir",
  76. light_source = 5,
  77. walkable = false,
  78. sunlight_propagates = false,
  79. groups = {snappy=1, oddly_breakable_by_hand=1},
  80. node_box = {
  81. type = "fixed",
  82. fixed = {
  83. {-0.125, -0.4375, -0.125, 0.125, 0.125, 0.125}, -- NodeBox25
  84. {-0.1875, 0.125, -0.1875, 0.1875, 0.1875, 0.1875}, -- NodeBox26
  85. {-0.0625, -0.5, -0.0625, 0, -0.4375, 0.375}, -- NodeBox27
  86. {-0.0625, -0.5, 0.3125, 0, 0.5, 0.375}, -- NodeBox28
  87. }
  88. },
  89. sounds = default.node_sound_wood_defaults(),
  90. })
  91. minetest.register_node("scifi_nodes:egg", {
  92. description = "Alien Egg",
  93. tiles = {
  94. "scifi_nodes_egg_top.png",
  95. "scifi_nodes_egg_top.png",
  96. "scifi_nodes_egg_side.png",
  97. "scifi_nodes_egg_side.png",
  98. "scifi_nodes_egg_side.png",
  99. "scifi_nodes_egg_side.png"
  100. },
  101. sunlight_propagates = false,
  102. drawtype = "nodebox",
  103. paramtype = "light",
  104. groups = {cracky=1, oddly_breakable_by_hand=1, dig_immediate=2, falling_node=1},
  105. light_source = 5,
  106. node_box = {
  107. type = "fixed",
  108. fixed = {
  109. {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1
  110. {-0.375, -0.4375, -0.375, 0.375, -0.3125, 0.375}, -- NodeBox2
  111. {-0.4375, -0.3125, -0.375, 0.4375, 0.3125, 0.375}, -- NodeBox3
  112. {-0.375, 0.3125, -0.375, 0.375, 0.4375, 0.375}, -- NodeBox4
  113. {-0.3125, 0.4375, -0.3125, 0.3125, 0.5625, 0.3125}, -- NodeBox5
  114. {-0.25, 0.5625, -0.25, 0.25, 0.6875, 0.25}, -- NodeBox6
  115. {-0.1875, 0.6875, -0.1875, 0.1875, 0.75, 0.1875}, -- NodeBox7
  116. {-0.125, 0.75, -0.125, 0.125, 0.8125, 0.125}, -- NodeBox8
  117. {-0.375, -0.3125, -0.4375, 0.375, 0.3125, 0.4375}, -- NodeBox9
  118. },
  119. sounds = default.node_sound_wood_defaults()
  120. }
  121. })
  122. if minetest.get_modpath("scifi_mobs") then
  123. minetest.register_abm({
  124. nodenames = {"scifi_nodes:egg"},
  125. interval = 30, chance = 10,
  126. action = function(pos, node, _, _)
  127. minetest.env:add_entity(pos, "scifi_mobs:xenomorph")
  128. minetest.env:remove_node(pos)
  129. end
  130. })
  131. end
  132. minetest.register_node("scifi_nodes:pad", {
  133. description = "teleport pad",
  134. tiles = {
  135. "scifi_nodes_pad.png",
  136. "scifi_nodes_pad.png",
  137. "scifi_nodes_pad.png",
  138. "scifi_nodes_pad.png",
  139. "scifi_nodes_pad.png",
  140. "scifi_nodes_pad.png"
  141. },
  142. drawtype = "nodebox",
  143. paramtype = "light",
  144. groups = {cracky=1, oddly_breakable_by_hand=1},
  145. light_source = 5,
  146. after_place_node = function(pos, placer, itemstack, pointed_thing)
  147. local placer_name = placer:get_player_name()
  148. local meta = minetest.get_meta(pos)
  149. if position1 == nil then
  150. position1 = pos
  151. meta:set_int("type", 1)
  152. elseif position2 == nil then
  153. position2 = pos
  154. meta:set_int("type", 2)
  155. else
  156. minetest.chat_send_player(placer_name, "There can only be two teleportation pads at a time!")
  157. end
  158. end,
  159. on_rightclick = function(pos, node, clicker)
  160. local clicker_name = clicker:get_player_name()
  161. local meta = minetest.get_meta(pos)
  162. if meta:get_int("type") == 1 and position2 ~= nil and position1 ~= nil then
  163. minetest.add_particlespawner(
  164. 25, --amount
  165. 1.5, --time
  166. {x=pos.x-0.9, y=pos.y-0.3, z=pos.z-0.9}, --minpos
  167. {x=pos.x+0.9, y=pos.y-0.3, z=pos.z+0.9}, --maxpos
  168. {x=0, y=0, z=0}, --minvel
  169. {x=0, y=0, z=0}, --maxvel
  170. {x=-0,y=1,z=-0}, --minacc
  171. {x=0,y=2,z=0}, --maxacc
  172. 0.5, --minexptime
  173. 1, --maxexptime
  174. 2, --minsize
  175. 5, --maxsize
  176. false, --collisiondetection
  177. "scifi_nodes_tp_part.png" --texture
  178. )
  179. minetest.after(1, function()
  180. local ppos = clicker:getpos()
  181. if minetest.get_node({x=ppos.x, y=ppos.y, z=ppos.z}).name == "scifi_nodes:pad" then
  182. clicker:setpos(position2)
  183. end
  184. local objs = minetest.env:get_objects_inside_radius(pos, 3)
  185. for _, obj in pairs(objs) do
  186. if obj:get_luaentity() and not obj:is_player() then
  187. if obj:get_luaentity().name == "__builtin:item" then
  188. local item1 = obj:get_luaentity().itemstring
  189. local obj2 = minetest.env:add_entity(position2, "__builtin:item")
  190. obj2:get_luaentity():set_item(item1)
  191. obj:remove()
  192. end
  193. end
  194. end
  195. end)
  196. elseif meta:get_int("type") == 2 and position1 ~= nil and position2 ~= nil then
  197. minetest.add_particlespawner(
  198. 25, --amount
  199. 1.5, --time
  200. {x=pos.x-0.9, y=pos.y-0.3, z=pos.z-0.9}, --minpos
  201. {x=pos.x+0.9, y=pos.y-0.3, z=pos.z+0.9}, --maxpos
  202. {x=0, y=0, z=0}, --minvel
  203. {x=0, y=0, z=0}, --maxvel
  204. {x=-0,y=1,z=-0}, --minacc
  205. {x=0,y=2,z=0}, --maxacc
  206. 0.5, --minexptime
  207. 1, --maxexptime
  208. 2, --minsize
  209. 5, --maxsize
  210. false, --collisiondetection
  211. "scifi_nodes_tp_part.png" --texture
  212. )
  213. minetest.after(1, function()
  214. local ppos = clicker:getpos()
  215. if minetest.get_node({x=ppos.x, y=ppos.y, z=ppos.z}).name == "scifi_nodes:pad" then
  216. clicker:setpos(position1)
  217. end
  218. local objs = minetest.env:get_objects_inside_radius(pos, 3)
  219. for _, obj in pairs(objs) do
  220. if obj:get_luaentity() and not obj:is_player() then
  221. if obj:get_luaentity().name == "__builtin:item" then
  222. local item1 = obj:get_luaentity().itemstring
  223. local obj2 = minetest.env:add_entity(position1, "__builtin:item")
  224. obj2:get_luaentity():set_item(item1)
  225. obj:remove()
  226. end
  227. end
  228. end
  229. end)
  230. elseif position1 == nil and meta:get_int("type") ~= 2 then
  231. position1 = pos
  232. meta:set_int("type", 1)
  233. minetest.chat_send_player(clicker_name, "Teleporter 1 connected at "..minetest.pos_to_string(pos))
  234. elseif position2 == nil and meta:get_int("type") ~= 1 then
  235. position2 = pos
  236. meta:set_int("type", 2)
  237. minetest.chat_send_player(clicker_name, "Teleporter 2 connected at "..minetest.pos_to_string(pos))
  238. else minetest.chat_send_player(clicker_name, "Teleporter error!")
  239. end
  240. end,
  241. on_destruct = function(pos, oldnode, placer)
  242. local meta = minetest.get_meta(pos)
  243. if meta:get_int("type") == 1 then
  244. position1 = nil
  245. meta:set_int("type", 0)
  246. elseif meta:get_int("type") == 2 then
  247. position2 = nil
  248. meta:set_int("type", 0)
  249. end
  250. end,
  251. node_box = {
  252. type = "fixed",
  253. fixed = {
  254. {-0.9375, -0.5, -0.75, 0.875, -0.375, 0.75}, -- NodeBox1
  255. {-0.8125, -0.5, -0.875, 0.75, -0.375, 0.875}, -- NodeBox2
  256. {-0.875, -0.5, -0.8125, 0.8125, -0.375, 0.8125}, -- NodeBox3
  257. {-0.8125, -0.5, -0.75, 0.75, -0.3125, 0.75}, -- NodeBox4
  258. },
  259. sounds = default.node_sound_wood_defaults()
  260. }
  261. })
  262. minetest.register_node("scifi_nodes:pplwndw", {
  263. description = "Purple Window",
  264. tiles = {
  265. "scifi_nodes_purple.png",
  266. "scifi_nodes_purple.png",
  267. "scifi_nodes_purple.png",
  268. "scifi_nodes_purple.png",
  269. "scifi_nodes_pplwndw.png",
  270. "scifi_nodes_pplwndw.png"
  271. },
  272. drawtype = "nodebox",
  273. paramtype = "light",
  274. paramtype2 = "facedir",
  275. use_texture_alpha = true,
  276. groups = {cracky=3},
  277. sounds = default.node_sound_glass_defaults(),
  278. node_box = {
  279. type = "fixed",
  280. fixed = {
  281. {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625}, -- NodeBox1
  282. }
  283. }
  284. })
  285. minetest.register_node("scifi_nodes:gloshroom", {
  286. description = "Gloshroom",
  287. tiles = {
  288. "scifi_nodes_gloshroom.png",
  289. "scifi_nodes_gloshroom_under.png",
  290. "scifi_nodes_gloshroom.png",
  291. "scifi_nodes_gloshroom.png",
  292. "scifi_nodes_gloshroom.png",
  293. "scifi_nodes_gloshroom.png"
  294. },
  295. drawtype = "nodebox",
  296. paramtype = "light",
  297. light_source = default.LIGHT_MAX,
  298. walkable = false,
  299. buildable_to = true,
  300. sunlight_propagates = false,
  301. use_texture_alpha = true,
  302. groups = {fleshy=1, oddly_breakable_by_hand=1, dig_immediate=3},
  303. node_box = {
  304. type = "fixed",
  305. fixed = {
  306. {-0.05, -0.5, -0.05, 0.05, 0.0625, 0.05}, -- NodeBox1
  307. {-0.4375, -0.0625, -0.375, 0.4375, 0, 0.375}, -- NodeBox2
  308. {-0.375, 0, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox3
  309. {-0.3125, 0.0625, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox4
  310. {-0.1875, 0.125, -0.1875, 0.1875, 0.1875, 0.1875}, -- NodeBox5
  311. {-0.375, -0.0625, -0.4375, 0.375, 0, 0.4375}, -- NodeBox6
  312. }
  313. }
  314. })
  315. minetest.register_node("scifi_nodes:pot_lid", {
  316. description = "plant pot lid(place above plant)",
  317. tiles = {
  318. "scifi_nodes_glass2.png",
  319. "scifi_nodes_glass2.png",
  320. "scifi_nodes_glass2.png",
  321. "scifi_nodes_glass2.png",
  322. "scifi_nodes_glass2.png",
  323. "scifi_nodes_glass2.png"
  324. },
  325. inventory_image = "scifi_nodes_pod_inv.png",
  326. wield_image = "scifi_nodes_pod_inv.png",
  327. use_texture_alpha = true,
  328. drawtype = "nodebox",
  329. paramtype = "light",
  330. groups = {cracky=1, not_in_creative_inventory=1},
  331. sunlight_propagates = true,
  332. selection_box = {
  333. type = "fixed",
  334. fixed = {0, 0, 0, 0, 0, 0}
  335. },
  336. collision_box = {
  337. type = "fixed",
  338. fixed = {-0.5, -1.5, -0.5, 0.5, -0.5, 0.5}
  339. },
  340. node_box = {
  341. type = "fixed",
  342. fixed = {
  343. {-0.1875, -0.5625, -0.1875, 0.1875, -0.5, 0.1875}, -- NodeBox13
  344. {-0.25, -0.625, -0.25, 0.25, -0.5625, 0.25}, -- NodeBox14
  345. {-0.3125, -0.6875, -0.3125, 0.3125, -0.625, 0.3125}, -- NodeBox15
  346. {-0.375, -0.75, -0.375, 0.375, -0.6875, 0.375}, -- NodeBox16
  347. {-0.4375, -0.75, 0.375, 0.4375, -1.5, 0.4375}, -- NodeBox17
  348. {-0.4375, -0.75, -0.4375, 0.4375, -1.5, -0.375}, -- NodeBox18
  349. {0.375, -0.75, -0.4375, 0.4375, -1.5, 0.4375}, -- NodeBox19
  350. {-0.4375, -0.75, -0.4375, -0.375, -1.5, 0.4375}, -- NodeBox20
  351. }
  352. },
  353. sounds = default.node_sound_glass_defaults()
  354. })
  355. minetest.register_node("scifi_nodes:pot", {
  356. description = "metal plant pot (right click for lid, shift+rightclick to plant)",
  357. tiles = {
  358. "scifi_nodes_pot.png",
  359. "scifi_nodes_greybolts.png",
  360. "scifi_nodes_greybolts.png",
  361. "scifi_nodes_greybolts.png",
  362. "scifi_nodes_greybolts.png",
  363. "scifi_nodes_greybolts.png"
  364. },
  365. drawtype = "nodebox",
  366. paramtype = "light",
  367. groups = {cracky=1, soil=1, sand=1},
  368. node_box = {
  369. type = "fixed",
  370. fixed = {
  371. {-0.5, -0.25, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
  372. {0.1875, -0.5, 0.1875, 0.5, -0.25, 0.5}, -- NodeBox2
  373. {-0.5, -0.5, -0.5, -0.1875, -0.25, -0.1875}, -- NodeBox3
  374. {-0.5, -0.5, 0.1875, -0.1875, -0.25, 0.5}, -- NodeBox4
  375. {0.1875, -0.5, -0.5, 0.5, -0.25, -0.1875}, -- NodeBox5
  376. }
  377. },
  378. on_rightclick = function(pos, node, clicker, item, _)
  379. local lid_node = minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z})
  380. if lid_node.name == "scifi_nodes:pot_lid" then
  381. minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="air", param2=lid_node.param2})
  382. elseif lid_node.name ~= "scifi_nodes:pot_lid" and node.name == "air" then
  383. minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="scifi_nodes:pot_lid", param2=lid_node.param2})
  384. end
  385. end,
  386. on_destruct = function(pos, node, _)
  387. minetest.remove_node({x=pos.x, y=pos.y+2, z=pos.z})
  388. end
  389. })
  390. minetest.register_node("scifi_nodes:pot2", {
  391. description = "metal wet plant pot(right click for lid, shift+rightclick to plant)",
  392. tiles = {
  393. "scifi_nodes_pot.png^[colorize:black:100",
  394. "scifi_nodes_greybolts.png",
  395. "scifi_nodes_greybolts.png",
  396. "scifi_nodes_greybolts.png",
  397. "scifi_nodes_greybolts.png",
  398. "scifi_nodes_greybolts.png"
  399. },
  400. drawtype = "nodebox",
  401. paramtype = "light",
  402. groups = {cracky=1, soil=3, wet=1},
  403. node_box = {
  404. type = "fixed",
  405. fixed = {
  406. {-0.5, -0.25, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
  407. {0.1875, -0.5, 0.1875, 0.5, -0.25, 0.5}, -- NodeBox2
  408. {-0.5, -0.5, -0.5, -0.1875, -0.25, -0.1875}, -- NodeBox3
  409. {-0.5, -0.5, 0.1875, -0.1875, -0.25, 0.5}, -- NodeBox4
  410. {0.1875, -0.5, -0.5, 0.5, -0.25, -0.1875}, -- NodeBox5
  411. }
  412. },
  413. on_rightclick = function(pos, node, clicker, item, _)
  414. local lid_node = minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z})
  415. if lid_node.name == "scifi_nodes:pot_lid" then
  416. minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="air", param2=lid_node.param2})
  417. elseif lid_node.name ~= "scifi_nodes:pot_lid" and node.name == "air" then
  418. minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="scifi_nodes:pot_lid", param2=lid_node.param2})
  419. end
  420. end,
  421. on_destruct = function(pos, node, _)
  422. minetest.remove_node({x=pos.x, y=pos.y+2, z=pos.z})
  423. end
  424. })
  425. minetest.register_node("scifi_nodes:lightbar", {
  426. description = "ceiling light",
  427. tiles = {
  428. "scifi_nodes_white2.png",
  429. },
  430. drawtype = "nodebox",
  431. paramtype = "light",
  432. paramtype2 = "wallmounted",
  433. sunlight_propagates = true,
  434. light_source = default.LIGHT_MAX,
  435. node_box = {
  436. type = "fixed",
  437. fixed = {
  438. {-0.125, -0.5, -0.5, 0.125, -0.375, 0.5}, -- NodeBox1
  439. }
  440. },
  441. selection_box = {
  442. type = "wallmounted",
  443. wallmounted = {
  444. {-0.125, -0.5, -0.5, 0.125, -0.375, 0.5}, -- NodeBox1
  445. }
  446. },
  447. groups = {cracky=1},
  448. sounds = default.node_sound_glass_defaults()
  449. })
  450. minetest.register_node("scifi_nodes:light_dynamic", {
  451. description = "Wall light",
  452. tiles = {
  453. "scifi_nodes_lightoverlay.png",
  454. },
  455. inventory_image = "scifi_nodes_lightoverlay.png",
  456. wield_image = "scifi_nodes_lightoverlay.png",
  457. drawtype = "signlike",
  458. paramtype = "light",
  459. selection_box = {
  460. type = "wallmounted",
  461. fixed = {-0.5, -0.5, -0.5, -0.45, 0.5, 0.5}
  462. },
  463. paramtype2 = "wallmounted",
  464. light_source = default.LIGHT_MAX,
  465. groups = {cracky=1, oddly_breakable_by_hand=1},
  466. sounds = default.node_sound_glass_defaults()
  467. })
  468. minetest.register_node("scifi_nodes:ladder", {
  469. description = "Metal Ladder",
  470. tiles = {
  471. "scifi_nodes_ladder.png",
  472. },
  473. drawtype = "nodebox",
  474. paramtype = "light",
  475. selection_box = {
  476. type = "wallmounted",
  477. fixed = {-0.5, -0.5, -0.5, -0.45, 0.5, 0.5}
  478. },
  479. node_box = {
  480. type = "fixed",
  481. fixed = {
  482. {0.3125, -0.5, -0.4375, 0.4375, -0.375, -0.3125}, -- NodeBox12
  483. {-0.4375, -0.5, -0.4375, -0.3125, -0.375, -0.3125}, -- NodeBox13
  484. {-0.375, -0.375, -0.4375, 0.375, -0.3125, -0.3125}, -- NodeBox14
  485. {-0.375, -0.375, 0.3125, 0.375, -0.3125, 0.4375}, -- NodeBox18
  486. {-0.375, -0.375, 0.0625, 0.375, -0.3125, 0.1875}, -- NodeBox19
  487. {-0.375, -0.375, -0.1875, 0.375, -0.3125, -0.0625}, -- NodeBox20
  488. {-0.4375, -0.5, -0.1875, -0.3125, -0.375, -0.0625}, -- NodeBox21
  489. {-0.4375, -0.5, 0.0625, -0.3125, -0.375, 0.1875}, -- NodeBox22
  490. {-0.4375, -0.5, 0.3125, -0.3125, -0.375, 0.4375}, -- NodeBox23
  491. {0.3125, -0.5, 0.3125, 0.4375, -0.375, 0.4375}, -- NodeBox24
  492. {0.3125, -0.5, 0.0625, 0.4375, -0.375, 0.1875}, -- NodeBox25
  493. {0.3125, -0.5, -0.1875, 0.4375, -0.375, -0.0625}, -- NodeBox26
  494. },
  495. sounds = default.node_sound_metal_defaults()
  496. },
  497. paramtype2 = "wallmounted",
  498. walkable = false,
  499. climbable = true,
  500. groups = {cracky=1, oddly_breakable_by_hand=1},
  501. })
  502. minetest.register_node("scifi_nodes:lightbars", {
  503. description = "orange lightbars",
  504. tiles = {
  505. "scifi_nodes_orange2.png",
  506. },
  507. drawtype = "nodebox",
  508. paramtype = "light",
  509. use_texture_alpha = true,
  510. light_source = default.LIGHT_MAX,
  511. node_box = {
  512. type = "fixed",
  513. fixed = {
  514. {0.125, -0.5, 0.125, 0.375, 0.5, 0.375}, -- NodeBox1
  515. {-0.375, -0.5, 0.125, -0.125, 0.5, 0.375}, -- NodeBox2
  516. {-0.375, -0.5, -0.375, -0.125, 0.5, -0.125}, -- NodeBox3
  517. {0.125, -0.5, -0.375, 0.375, 0.5, -0.125}, -- NodeBox4
  518. }
  519. },
  520. groups = {cracky=1},
  521. sounds = default.node_sound_glass_defaults()
  522. })
  523. minetest.register_node("scifi_nodes:liquid_pipe", {
  524. description = "Liquid pipe",
  525. tiles = {{
  526. name = "scifi_nodes_liquid.png",
  527. animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00},
  528. }},
  529. use_texture_alpha = true,
  530. light_source = default.LIGHT_MAX,
  531. drawtype = "nodebox",
  532. sunlight_propagates = true,
  533. paramtype = "light",
  534. node_box = {
  535. type = "fixed",
  536. fixed = {
  537. {-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}, -- NodeBox1
  538. }
  539. },
  540. groups = {cracky=1, oddly_breakable_by_hand=1},
  541. sounds = default.node_sound_glass_defaults()
  542. })
  543. minetest.register_node("scifi_nodes:liquid_pipe2", {
  544. description = "Liquid pipe 2",
  545. tiles = {
  546. "scifi_nodes_orange.png",
  547. },
  548. use_texture_alpha = true,
  549. light_source = default.LIGHT_MAX,
  550. drawtype = "nodebox",
  551. sunlight_propagates = true,
  552. paramtype = "light",
  553. node_box = {
  554. type = "fixed",
  555. fixed = {
  556. {-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}, -- NodeBox1
  557. }
  558. },
  559. groups = {cracky=1, oddly_breakable_by_hand=1},
  560. sounds = default.node_sound_glass_defaults()
  561. })
  562. minetest.register_node("scifi_nodes:powered_stand", {
  563. description = "powered stand",
  564. tiles = {
  565. "scifi_nodes_pwrstnd_top.png",
  566. "scifi_nodes_pwrstnd_top.png",
  567. "scifi_nodes_pwrstnd_side.png",
  568. "scifi_nodes_pwrstnd_side.png",
  569. "scifi_nodes_pwrstnd_side.png",
  570. "scifi_nodes_pwrstnd_side.png"
  571. },
  572. drawtype = "nodebox",
  573. paramtype = "light",
  574. node_box = {
  575. type = "fixed",
  576. fixed = {
  577. {-0.375, 0.25, -0.3125, 0.375, 0.4375, 0.3125}, -- NodeBox1
  578. {-0.3125, 0.25, -0.375, 0.3125, 0.4375, 0.375}, -- NodeBox2
  579. {-0.3125, 0.4375, -0.3125, 0.3125, 0.5, 0.3125}, -- NodeBox3
  580. {-0.5, -0.5, -0.125, 0.5, 0.125, 0.125}, -- NodeBox4
  581. {-0.125, -0.5, -0.5, 0.125, 0.125, 0.5}, -- NodeBox5
  582. {-0.4375, 0.125, -0.125, 0.4375, 0.25, 0.125}, -- NodeBox6
  583. {-0.125, 0.125, -0.4375, 0.125, 0.25, 0.4375}, -- NodeBox7
  584. {-0.3125, -0.5, -0.375, 0.3125, 0.0625, 0.3125}, -- NodeBox8
  585. {-0.25, 0.0625, -0.3125, 0.25, 0.125, 0.3125}, -- NodeBox9
  586. }
  587. },
  588. groups = {cracky=1, oddly_breakable_by_hand=1},
  589. on_rightclick = function(pos, node, clicker, item, _)
  590. local wield_item_stack = clicker:get_wielded_item()
  591. local wield_item = wield_item_stack:get_name()
  592. local taken = item:take_item()
  593. if taken and not taken:is_empty() then
  594. if wield_item_stack:get_count() == 1 then
  595. -- only 1 item in "hands" copy over entire stack with metadata
  596. wield_item = wield_item_stack
  597. end
  598. minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, wield_item)
  599. return item
  600. end
  601. end,
  602. })
  603. minetest.register_node("scifi_nodes:cover", {
  604. description = "Metal cover",
  605. tiles = {
  606. "scifi_nodes_pwrstnd_top.png",
  607. "scifi_nodes_pwrstnd_top.png",
  608. "scifi_nodes_pwrstnd_top.png",
  609. "scifi_nodes_pwrstnd_top.png",
  610. "scifi_nodes_pwrstnd_top.png",
  611. "scifi_nodes_pwrstnd_top.png"
  612. },
  613. drawtype = "nodebox",
  614. paramtype = "light",
  615. node_box = {
  616. type = "fixed",
  617. fixed = {
  618. {-0.375, -0.5, -0.3125, 0.375, -0.375, 0.3125}, -- NodeBox1
  619. {-0.3125, -0.5, -0.375, 0.3125, -0.375, 0.375}, -- NodeBox5
  620. {-0.3125, -0.375, -0.3125, 0.3125, -0.3125, 0.3125}, -- NodeBox6
  621. }
  622. },
  623. sounds = default.node_sound_wood_defaults(),
  624. groups = {cracky=1, oddly_breakable_by_hand=1}
  625. })
  626. minetest.register_node("scifi_nodes:computer", {
  627. description = "computer",
  628. tiles = {
  629. "scifi_nodes_black.png",
  630. "scifi_nodes_black.png",
  631. "scifi_nodes_blackvent.png",
  632. "scifi_nodes_black.png",
  633. "scifi_nodes_mesh2.png",
  634. "scifi_nodes_pc.png"
  635. },
  636. drawtype = "nodebox",
  637. paramtype = "light",
  638. paramtype2 = "facedir",
  639. sunlight_propagates = true,
  640. node_box = {
  641. type = "fixed",
  642. fixed = {
  643. {-0.4375, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox1
  644. }
  645. },
  646. groups = {cracky=1, oddly_breakable_by_hand=1}
  647. })
  648. minetest.register_node("scifi_nodes:keysmonitor", {
  649. description = "Keyboard and monitor",
  650. tiles = {
  651. "scifi_nodes_keyboard.png",
  652. "scifi_nodes_black.png",
  653. "scifi_nodes_black.png",
  654. "scifi_nodes_black.png",
  655. "scifi_nodes_black.png",
  656. "scifi_nodes_monitor.png"
  657. },
  658. drawtype = "nodebox",
  659. paramtype = "light",
  660. sunlight_propagates = true,
  661. paramtype2 = "facedir",
  662. node_box = {
  663. type = "fixed",
  664. fixed = {
  665. {-0.5, -0.5, -0.4375, 0.5, -0.4375, -0.0625}, -- NodeBox1
  666. {-0.125, -0.5, 0.375, 0.125, 0.0625, 0.4375}, -- NodeBox2
  667. {-0.25, -0.5, 0.125, 0.25, -0.4375, 0.5}, -- NodeBox3
  668. {-0.5, -0.3125, 0.25, 0.5, 0.5, 0.375}, -- NodeBox4
  669. }
  670. },
  671. groups = {cracky=1, oddly_breakable_by_hand=1}
  672. })
  673. minetest.register_node("scifi_nodes:microscope", {
  674. description = "Microscope",
  675. tiles = {
  676. "scifi_nodes_white.png",
  677. "scifi_nodes_black.png",
  678. "scifi_nodes_white_vent.png",
  679. "scifi_nodes_white_vent.png",
  680. "scifi_nodes_white_vent.png",
  681. "scifi_nodes_white_vent.png"
  682. },
  683. drawtype = "nodebox",
  684. paramtype = "light",
  685. paramtype2 = "facedir",
  686. sunlight_propagates = true,
  687. node_box = {
  688. type = "fixed",
  689. fixed = {
  690. {-0.25, -0.5, -0.3125, 0.25, -0.375, 0.3125}, -- NodeBox1
  691. {-0.0625, -0.5, 0.125, 0.0625, 0.3125, 0.25}, -- NodeBox2
  692. {-0.0625, -0.0625, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox3
  693. {-0.0625, 0.0625, 0.0625, 0.0625, 0.25, 0.125}, -- NodeBox4
  694. {-0.125, -0.25, -0.125, 0.125, -0.1875, 0.1875}, -- NodeBox5
  695. }
  696. },
  697. groups = {cracky=1, oddly_breakable_by_hand=1}
  698. })
  699. minetest.register_node("scifi_nodes:table", {
  700. description = "Metal table",
  701. tiles = {
  702. "scifi_nodes_grey.png",
  703. "scifi_nodes_grey.png",
  704. "scifi_nodes_grey.png",
  705. "scifi_nodes_grey.png",
  706. "scifi_nodes_grey.png",
  707. "scifi_nodes_grey.png"
  708. },
  709. drawtype = "nodebox",
  710. paramtype = "light",
  711. paramtype2 = "facedir",
  712. node_box = {
  713. type = "fixed",
  714. fixed = {
  715. {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
  716. {-0.0625, -0.5, 0.125, 0.0625, 0.5, 0.3125}, -- NodeBox2
  717. {-0.0625, -0.5, 0.375, 0.0625, 0.5, 0.4375}, -- NodeBox3
  718. {-0.0625, -0.375, 0.0625, 0.0625, 0.4375, 0.125}, -- NodeBox4
  719. {-0.0625, -0.1875, 0, 0.0625, 0.4375, 0.0625}, -- NodeBox5
  720. {-0.0625, 0.0625, -0.0625, 0.0625, 0.4375, 0}, -- NodeBox6
  721. {-0.0625, 0.25, -0.125, 0.0625, 0.4375, -0.0625}, -- NodeBox7
  722. }
  723. },
  724. sounds = default.node_sound_metal_defaults(),
  725. groups = {cracky=1}
  726. })
  727. minetest.register_node("scifi_nodes:laptop_open", {
  728. description = "laptop",
  729. tiles = {
  730. "scifi_nodes_lapkey.png",
  731. "scifi_nodes_black.png",
  732. "scifi_nodes_black.png",
  733. "scifi_nodes_black.png",
  734. "scifi_nodes_black.png",
  735. "scifi_nodes_laptop.png"
  736. },
  737. drawtype = "nodebox",
  738. paramtype = "light",
  739. paramtype2 = "facedir",
  740. sunlight_propagates = true,
  741. node_box = {
  742. type = "fixed",
  743. fixed = {
  744. {-0.4375, -0.5, -0.4375, 0.4375, -0.375, 0.3125}, -- NodeBox1
  745. {-0.4375, -0.375, 0.3125, 0.4375, 0.4375, 0.4375}, -- NodeBox11
  746. }
  747. },
  748. groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  749. on_rightclick = function(pos, node, clicker, item, _)
  750. minetest.set_node(pos, {name="scifi_nodes:laptop_closed", param2=node.param2})
  751. end,
  752. })
  753. minetest.register_node("scifi_nodes:laptop_closed", {
  754. description = "laptop",
  755. tiles = {
  756. "scifi_nodes_black.png",
  757. "scifi_nodes_black.png",
  758. "scifi_nodes_black.png",
  759. "scifi_nodes_black.png",
  760. "scifi_nodes_black.png",
  761. "scifi_nodes_black.png"
  762. },
  763. drawtype = "nodebox",
  764. paramtype = "light",
  765. paramtype2 = "facedir",
  766. sunlight_propagates = true,
  767. node_box = {
  768. type = "fixed",
  769. fixed = {
  770. {-0.4375, -0.5, -0.4375, 0.4375, -0.25, 0.3125}, -- NodeBox1
  771. }
  772. },
  773. groups = {cracky=1, oddly_breakable_by_hand=1},
  774. on_rightclick = function(pos, node, clicker, item, _)
  775. minetest.set_node(pos, {name="scifi_nodes:laptop_open", param2=node.param2})
  776. end,
  777. })
  778. minetest.register_node("scifi_nodes:pipen", {
  779. description = "pipe(nodebox)",
  780. tiles = {
  781. "scifi_nodes_blacktile2.png",
  782. "scifi_nodes_blacktile2.png",
  783. "scifi_nodes_pipen.png",
  784. "scifi_nodes_pipen.png",
  785. "scifi_nodes_pipen.png",
  786. "scifi_nodes_pipen.png"
  787. },
  788. drawtype = "nodebox",
  789. paramtype = "light",
  790. paramtype2 = "facedir",
  791. node_box = {
  792. type = "fixed",
  793. fixed = {
  794. {-0.4375, -0.5, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox1
  795. {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox2
  796. {-0.5, 0.3125, -0.5, 0.5, 0.375, 0.5}, -- NodeBox3
  797. {-0.5, 0.1875, -0.5, 0.5, 0.25, 0.5}, -- NodeBox4
  798. {-0.5, 0.0625, -0.5, 0.5, 0.125, 0.5}, -- NodeBox5
  799. {-0.5, -0.0625, -0.5, 0.5, 0, 0.5}, -- NodeBox6
  800. {-0.5, -0.1875, -0.5, 0.5, -0.125, 0.5}, -- NodeBox7
  801. {-0.5, -0.3125, -0.5, 0.5, -0.25, 0.5}, -- NodeBox8
  802. {-0.5, -0.4375, -0.5, 0.5, -0.375, 0.5}, -- NodeBox9
  803. }
  804. },
  805. groups = {cracky=1},
  806. on_place = minetest.rotate_node
  807. })
  808. minetest.register_node("scifi_nodes:windowcorner", {
  809. description = "strong window corner",
  810. tiles = {
  811. "scifi_nodes_glassstrngsd2.png",
  812. "scifi_nodes_white.png",
  813. "scifi_nodes_glassstrngcrnr.png",
  814. "scifi_nodes_glassstrngcrnr2.png",
  815. "scifi_nodes_white.png",
  816. "scifi_nodes_glassstrngsd.png"
  817. },
  818. drawtype = "nodebox",
  819. paramtype = "light",
  820. use_texture_alpha = true,
  821. sunlight_propagates = true,
  822. paramtype2 = "facedir",
  823. node_box = {
  824. type = "fixed",
  825. fixed = {
  826. {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox1
  827. {-0.3125, -0.25, 0.25, 0.3125, -0.1875, 0.5}, -- NodeBox7
  828. {-0.3125, -0.25, 0.3125, 0.3125, -0.125, 0.375}, -- NodeBox8
  829. {-0.3125, -0.3125, 0.25, 0.3125, -0.1875, 0.3125}, -- NodeBox9
  830. {-0.3125, -0.5, 0.375, 0.3125, 0.5, 0.5}, -- NodeBox10
  831. {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  832. }
  833. },
  834. groups = {cracky=1},
  835. on_place = minetest.rotate_node,
  836. sounds = default.node_sound_glass_defaults(),
  837. })
  838. minetest.register_node("scifi_nodes:windowstraight", {
  839. description = "strong window",
  840. tiles = {
  841. "scifi_nodes_glassstrngsd2.png",
  842. "scifi_nodes_white.png",
  843. "scifi_nodes_glassstrng.png",
  844. "scifi_nodes_glassstrng.png",
  845. "scifi_nodes_glassstrngsd.png",
  846. "scifi_nodes_glassstrngsd.png"
  847. },
  848. drawtype = "nodebox",
  849. paramtype = "light",
  850. use_texture_alpha = true,
  851. sunlight_propagates = true,
  852. paramtype2 = "facedir",
  853. node_box = {
  854. type = "fixed",
  855. fixed = {
  856. {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox10
  857. {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  858. }
  859. },
  860. groups = {cracky=1},
  861. on_place = minetest.rotate_node,
  862. sounds = default.node_sound_glass_defaults(),
  863. })
  864. minetest.register_node("scifi_nodes:windowcorner2", {
  865. description = "strong window corner(black)",
  866. tiles = {
  867. "scifi_nodes_glassstrngsd4.png",
  868. "scifi_nodes_black.png",
  869. "scifi_nodes_glassstrngcrnr3.png",
  870. "scifi_nodes_glassstrngcrnr4.png",
  871. "scifi_nodes_black.png",
  872. "scifi_nodes_glassstrngsd3.png"
  873. },
  874. drawtype = "nodebox",
  875. paramtype = "light",
  876. use_texture_alpha = true,
  877. sunlight_propagates = true,
  878. paramtype2 = "facedir",
  879. node_box = {
  880. type = "fixed",
  881. fixed = {
  882. {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox1
  883. {-0.3125, -0.25, 0.25, 0.3125, -0.1875, 0.5}, -- NodeBox7
  884. {-0.3125, -0.25, 0.3125, 0.3125, -0.125, 0.375}, -- NodeBox8
  885. {-0.3125, -0.3125, 0.25, 0.3125, -0.1875, 0.3125}, -- NodeBox9
  886. {-0.3125, -0.5, 0.375, 0.3125, 0.5, 0.5}, -- NodeBox10
  887. {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  888. }
  889. },
  890. groups = {cracky=1},
  891. on_place = minetest.rotate_node,
  892. sounds = default.node_sound_glass_defaults(),
  893. })
  894. minetest.register_node("scifi_nodes:windowstraight2", {
  895. description = "strong window(black)",
  896. tiles = {
  897. "scifi_nodes_glassstrngsd4.png",
  898. "scifi_nodes_black.png",
  899. "scifi_nodes_glassstrng2.png",
  900. "scifi_nodes_glassstrng2.png",
  901. "scifi_nodes_glassstrngsd3.png",
  902. "scifi_nodes_glassstrngsd3.png"
  903. },
  904. drawtype = "nodebox",
  905. paramtype = "light",
  906. use_texture_alpha = true,
  907. sunlight_propagates = true,
  908. paramtype2 = "facedir",
  909. node_box = {
  910. type = "fixed",
  911. fixed = {
  912. {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox10
  913. {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  914. }
  915. },
  916. groups = {cracky=1},
  917. on_place = minetest.rotate_node,
  918. sounds = default.node_sound_glass_defaults(),
  919. })
  920. minetest.register_node("scifi_nodes:capsule", {
  921. description = "sample capsule",
  922. tiles = {
  923. "scifi_nodes_capsule.png",
  924. "scifi_nodes_capsule.png",
  925. "scifi_nodes_box_top.png",
  926. "scifi_nodes_box_top.png",
  927. "scifi_nodes_capsule.png",
  928. "scifi_nodes_capsule.png"
  929. },
  930. use_texture_alpha = true,
  931. drawtype = "nodebox",
  932. paramtype = "light",
  933. paramtype2 = "facedir",
  934. sunlight_propagates = true,
  935. node_box = {
  936. type = "fixed",
  937. fixed = {
  938. {0.3125, -0.5, -0.25, 0.5, 0, 0.25}, -- NodeBox1
  939. {-0.5, -0.5, -0.25, -0.3125, 0, 0.25}, -- NodeBox2
  940. {-0.3125, -0.4375, -0.1875, 0.3125, -0.0625, 0.1875}, -- NodeBox3
  941. }
  942. },
  943. groups = {cracky=1, oddly_breakable_by_hand=1},
  944. sounds = default.node_sound_glass_defaults(),
  945. on_rightclick = function(pos, node, clicker, item, _)
  946. minetest.set_node(pos, {name="scifi_nodes:capsule2", param2=node.param2})
  947. end,
  948. })
  949. minetest.register_node("scifi_nodes:capsule3", {
  950. description = "sample capsule",
  951. tiles = {
  952. "scifi_nodes_capsule3.png",
  953. "scifi_nodes_capsule3.png",
  954. "scifi_nodes_box_top.png",
  955. "scifi_nodes_box_top.png",
  956. "scifi_nodes_capsule3.png",
  957. "scifi_nodes_capsule3.png"
  958. },
  959. use_texture_alpha = true,
  960. drawtype = "nodebox",
  961. paramtype = "light",
  962. paramtype2 = "facedir",
  963. sunlight_propagates = true,
  964. node_box = {
  965. type = "fixed",
  966. fixed = {
  967. {0.3125, -0.5, -0.25, 0.5, 0, 0.25}, -- NodeBox1
  968. {-0.5, -0.5, -0.25, -0.3125, 0, 0.25}, -- NodeBox2
  969. {-0.3125, -0.4375, -0.1875, 0.3125, -0.0625, 0.1875}, -- NodeBox3
  970. }
  971. },
  972. groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  973. sounds = default.node_sound_glass_defaults(),
  974. on_rightclick = function(pos, node, clicker, item, _)
  975. minetest.set_node(pos, {name="scifi_nodes:capsule", param2=node.param2})
  976. end,
  977. })
  978. minetest.register_node("scifi_nodes:capsule2", {
  979. description = "sample capsule",
  980. tiles = {
  981. "scifi_nodes_capsule2.png",
  982. "scifi_nodes_capsule2.png",
  983. "scifi_nodes_box_top.png",
  984. "scifi_nodes_box_top.png",
  985. "scifi_nodes_capsule2.png",
  986. "scifi_nodes_capsule2.png"
  987. },
  988. use_texture_alpha = true,
  989. drawtype = "nodebox",
  990. paramtype = "light",
  991. paramtype2 = "facedir",
  992. sunlight_propagates = true,
  993. node_box = {
  994. type = "fixed",
  995. fixed = {
  996. {0.3125, -0.5, -0.25, 0.5, 0, 0.25}, -- NodeBox1
  997. {-0.5, -0.5, -0.25, -0.3125, 0, 0.25}, -- NodeBox2
  998. {-0.3125, -0.4375, -0.1875, 0.3125, -0.0625, 0.1875}, -- NodeBox3
  999. }
  1000. },
  1001. groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  1002. sounds = default.node_sound_glass_defaults(),
  1003. on_rightclick = function(pos, node, clicker, item, _)
  1004. minetest.set_node(pos, {name="scifi_nodes:capsule3", param2=node.param2})
  1005. end,
  1006. })
  1007. minetest.register_node("scifi_nodes:itemholder", {
  1008. description = "item holder",
  1009. tiles = {
  1010. "scifi_nodes_box_top.png",
  1011. "scifi_nodes_box_top.png",
  1012. "scifi_nodes_box_top.png",
  1013. "scifi_nodes_box_top.png",
  1014. "scifi_nodes_box_top.png",
  1015. "scifi_nodes_box_top.png"
  1016. },
  1017. drawtype = "nodebox",
  1018. paramtype = "light",
  1019. sunlight_propagates = true,
  1020. node_box = {
  1021. type = "fixed",
  1022. fixed = {
  1023. {-0.3125, -0.5, -0.3125, 0.3125, -0.25, 0.3125}, -- NodeBox1
  1024. {-0.0625, -0.5, 0.1875, 0.0625, -0.0625, 0.25}, -- NodeBox2
  1025. {-0.0625, -0.5, -0.25, 0.0625, -0.0625, -0.1875}, -- NodeBox3
  1026. {0.1875, -0.5, -0.0625, 0.25, -0.0625, 0.0625}, -- NodeBox4
  1027. {-0.25, -0.5, -0.0625, -0.1875, -0.0625, 0.0625}, -- NodeBox5
  1028. }
  1029. },
  1030. groups = {cracky=1},
  1031. on_rotate = screwdriver.disallow,
  1032. after_place_node = function(pos, placer, itemstack)
  1033. local meta = minetest.get_meta(pos)
  1034. meta:set_string("owner",placer:get_player_name())
  1035. meta:set_string("infotext", "Itemholder (owned by " ..
  1036. meta:get_string("owner") .. ")")
  1037. end,
  1038. on_rightclick = function(pos, node, clicker, item, _)
  1039. local name = clicker and clicker:get_player_name()
  1040. local meta = minetest.get_meta(pos)
  1041. if name == meta:get_string("owner") or
  1042. minetest.check_player_privs(name, "protection_bypass") then
  1043. local wield_item = clicker:get_wielded_item():get_name()
  1044. local taken = item:take_item()
  1045. if taken and not taken:is_empty() then
  1046. minetest.add_item(pos, wield_item)
  1047. return item
  1048. end
  1049. end
  1050. end,
  1051. can_dig = function(pos,player)
  1052. if not player then return end
  1053. local name = player and player:get_player_name()
  1054. local meta = minetest.get_meta(pos)
  1055. return name == meta:get_string("owner") or
  1056. minetest.check_player_privs(name, "protection_bypass")
  1057. end,
  1058. on_destruct = function(pos)
  1059. local meta = minetest.get_meta(pos)
  1060. if meta:get_string("item") ~= "" then
  1061. minetest.add_item(pos, meta:get_string("item"))
  1062. end
  1063. end,
  1064. })
  1065. minetest.register_node("scifi_nodes:glassscreen", {
  1066. description = "glass screen",
  1067. tiles = {
  1068. "scifi_nodes_glscrn.png",
  1069. "scifi_nodes_glscrn.png",
  1070. "scifi_nodes_glscrn.png",
  1071. "scifi_nodes_glscrn.png",
  1072. "scifi_nodes_glscrn.png",
  1073. "scifi_nodes_glscrn.png"
  1074. },
  1075. use_texture_alpha = true,
  1076. drawtype = "nodebox",
  1077. paramtype = "light",
  1078. paramtype2 = "facedir",
  1079. light_source = default.LIGHT_MAX,
  1080. sunlight_propagates = true,
  1081. node_box = {
  1082. type = "fixed",
  1083. fixed = {
  1084. {-0.4375, -0.5, -0.125, 0.4375, -0.1875, 0.0625}, -- NodeBox1
  1085. {-0.375, -0.5, -0.0625, 0.375, 0.5, 0}, -- NodeBox10
  1086. }
  1087. },
  1088. groups = {cracky=1, oddly_breakable_by_hand=1},
  1089. sounds = default.node_sound_glass_defaults(),
  1090. })
  1091. minetest.register_node("scifi_nodes:widescreen", {
  1092. description = "widescreen",
  1093. tiles = {
  1094. "scifi_nodes_black.png",
  1095. "scifi_nodes_black.png",
  1096. "scifi_nodes_black.png",
  1097. "scifi_nodes_black.png",
  1098. "scifi_nodes_black.png",
  1099. "scifi_nodes_widescreen.png"
  1100. },
  1101. drawtype = "nodebox",
  1102. paramtype = "light",
  1103. light_source = 5,
  1104. paramtype2 = "facedir",
  1105. sunlight_propagates = true,
  1106. node_box = {
  1107. type = "fixed",
  1108. fixed = {
  1109. {-0.375, -0.3125, 0.4375, 0.375, 0.3125, 0.5}, -- NodeBox1
  1110. {-0.5, -0.375, 0.375, -0.375, 0.375, 0.5}, -- NodeBox2
  1111. {0.375, -0.375, 0.375, 0.5, 0.375, 0.5}, -- NodeBox3
  1112. {-0.3125, 0.25, 0.375, 0.3125, 0.375, 0.5}, -- NodeBox4
  1113. {-0.3125, -0.375, 0.375, 0.25, -0.25, 0.5}, -- NodeBox5
  1114. {-0.5, -0.3125, 0.375, 0.5, -0.25, 0.5}, -- NodeBox6
  1115. {-0.5, 0.25, 0.375, 0.5, 0.3125, 0.5}, -- NodeBox7
  1116. }
  1117. },
  1118. groups = {cracky=1, oddly_breakable_by_hand=1}
  1119. })
  1120. minetest.register_node("scifi_nodes:tallscreen", {
  1121. description = "tallscreen",
  1122. tiles = {
  1123. "scifi_nodes_black.png",
  1124. "scifi_nodes_black.png",
  1125. "scifi_nodes_black.png",
  1126. "scifi_nodes_black.png",
  1127. "scifi_nodes_black.png",
  1128. "scifi_nodes_tallscreen.png"
  1129. },
  1130. drawtype = "nodebox",
  1131. light_source = 5,
  1132. paramtype = "light",
  1133. paramtype2 = "facedir",
  1134. sunlight_propagates = true,
  1135. node_box = {
  1136. type = "fixed",
  1137. fixed = {
  1138. {-0.3125, -0.375, 0.4375, 0.3125, 0.375, 0.5}, -- NodeBox1
  1139. {-0.375, 0.375, 0.375, 0.375, 0.5, 0.5}, -- NodeBox2
  1140. {-0.375, -0.5, 0.375, 0.375, -0.375, 0.5}, -- NodeBox3
  1141. {0.25, -0.3125, 0.375, 0.375, 0.3125, 0.5}, -- NodeBox4
  1142. {-0.375, -0.25, 0.375, -0.25, 0.3125, 0.5}, -- NodeBox5
  1143. {-0.3125, -0.5, 0.375, -0.25, 0.5, 0.5}, -- NodeBox6
  1144. {0.25, -0.5, 0.375, 0.3125, 0.5, 0.5}, -- NodeBox7
  1145. }
  1146. },
  1147. groups = {cracky=1, oddly_breakable_by_hand=1}
  1148. })
  1149. -- https://forum.minetest.net/viewtopic.php?f=10&t=13125&p=261481#p261481
  1150. minetest.register_node("scifi_nodes:windowpanel", {
  1151. description = "strong window panel",
  1152. tiles = {
  1153. "scifi_nodes_glass.png",
  1154. },
  1155. drawtype = "nodebox",
  1156. paramtype = "light",
  1157. use_texture_alpha = true,
  1158. sunlight_propagates = true,
  1159. paramtype2 = "facedir",
  1160. node_box = {
  1161. type = "fixed",
  1162. fixed = {
  1163. {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  1164. }
  1165. },
  1166. groups = {cracky=1},
  1167. on_place = minetest.rotate_node,
  1168. sounds = default.node_sound_glass_defaults(),
  1169. })