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.

1213 lines
35KB

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