Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 45.27 KB | None | 0 0
  1.  
  2. -- GENERATED CODE
  3. -- Node Box Editor, version 0.9.0
  4.  
  5. position1 = nil
  6. position2 = nil
  7.  
  8. minetest.register_node("scifi_nodes:alienslope", {
  9.     description = "Alien Platform",
  10.     tiles = {
  11.         "scifi_nodes_alnslp_top2.png",
  12.         "scifi_nodes_alnslp_top.png",
  13.         "scifi_nodes_alnslp.png",
  14.         "scifi_nodes_alnslp.png",
  15.         "scifi_nodes_alnslp_top.png",
  16.         "scifi_nodes_alnslp_top.png"
  17.     },
  18.     drawtype = "nodebox",
  19.     paramtype = "light",
  20.     paramtype2 = "facedir",
  21.     groups = {cracky=1},
  22.     node_box = {
  23.         type = "fixed",
  24.         fixed = {
  25.             {0, -0.5, -0.5, 0.5, 0.5, 0.5}, -- NodeBox10
  26.             {-0.5, -0.5, -0.5, 0, -0.25, 0.5}, -- NodeBox11
  27.             {-0.4375, -0.25, -0.5, 0, -0.125, 0.5}, -- NodeBox12
  28.             {-0.375, -0.125, -0.5, 0, 0, 0.5}, -- NodeBox13
  29.             {-0.3125, 0, -0.5, 0, 0.125, 0.5}, -- NodeBox14
  30.             {-0.25, 0.125, -0.5, 0, 0.25, 0.5}, -- NodeBox15
  31.             {-0.1875, 0.25, -0.5, 0.0625, 0.375, 0.5}, -- NodeBox16
  32.             {-0.125, 0.375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox17
  33.         }
  34.     },
  35.     sounds = default.node_sound_wood_defaults(),
  36.     on_place = minetest.rotate_node
  37. })
  38.  
  39. minetest.register_node("scifi_nodes:wallpipe", {
  40.     description = "Alien wall pipe",
  41.     tiles = {
  42.         "scifi_nodes_wallpipe.png",
  43.         "scifi_nodes_wallpipe.png",
  44.         "scifi_nodes_wallpipe.png",
  45.         "scifi_nodes_wallpipe.png",
  46.         "scifi_nodes_wallpipe.png",
  47.         "scifi_nodes_wallpipe.png"
  48.     },
  49.     drawtype = "nodebox",
  50.     paramtype = "light",
  51.     paramtype2 = "facedir",
  52.     groups = {cracky=1},
  53.     node_box = {
  54.         type = "fixed",
  55.         fixed = {
  56.             {-0.5, -0.5, 0.125, 0.5, 0.5, 0.5}, -- NodeBox18
  57.             {-0.1875, -0.5, -0.0625, 0.1875, 0.5, 0.125}, -- NodeBox19
  58.             {-0.125, -0.5, -0.125, 0.125, 0.5, 0.125}, -- NodeBox20
  59.             {0.3125, -0.5, 0.0625, 0.4375, 0.5, 0.125}, -- NodeBox21
  60.             {-0.4375, -0.5, 0.0625, -0.3125, 0.5, 0.125}, -- NodeBox22
  61.             {-0.5, 0.0625, 0, 0.5, 0.1875, 0.0625}, -- NodeBox23
  62.             {-0.5, -0.125, 0, 0.5, 0, 0.0625}, -- NodeBox24
  63.         }
  64.     },
  65.     sounds = default.node_sound_wood_defaults()
  66. })
  67.  
  68. minetest.register_node("scifi_nodes:plant_trap", {
  69.     description = "Hanging Trap Plant",
  70.     tiles = {
  71.         "scifi_nodes_traplant_top.png",
  72.         "scifi_nodes_traplant_side.png",
  73.         "scifi_nodes_traplant_side.png",
  74.         "scifi_nodes_traplant_side.png",
  75.         "scifi_nodes_traplant_side.png",
  76.         "scifi_nodes_traplant_side.png"
  77.     },
  78.     drawtype = "nodebox",
  79.     paramtype = "light",
  80.     paramtype2 = "facedir",
  81.     light_source = 5,
  82.     walkable = false,
  83.     sunlight_propagates = false,
  84.     groups = {snappy=1, oddly_breakable_by_hand=1},
  85.     node_box = {
  86.         type = "fixed",
  87.         fixed = {
  88.             {-0.125, -0.4375, -0.125, 0.125, 0.125, 0.125}, -- NodeBox25
  89.             {-0.1875, 0.125, -0.1875, 0.1875, 0.1875, 0.1875}, -- NodeBox26
  90.             {-0.0625, -0.5, -0.0625, 0, -0.4375, 0.375}, -- NodeBox27
  91.             {-0.0625, -0.5, 0.3125, 0, 0.5, 0.375}, -- NodeBox28
  92.         }
  93.     },
  94.     sounds = default.node_sound_wood_defaults(),
  95. })
  96.  
  97. minetest.register_node("scifi_nodes:egg", {
  98.     description = "Alien Egg",
  99.     tiles = {
  100.         "scifi_nodes_egg_top.png",
  101.         "scifi_nodes_egg_top.png",
  102.         "scifi_nodes_egg_side.png",
  103.         "scifi_nodes_egg_side.png",
  104.         "scifi_nodes_egg_side.png",
  105.         "scifi_nodes_egg_side.png"
  106.     },
  107.     sunlight_propagates = false,
  108.     drawtype = "nodebox",
  109.     paramtype = "light",
  110.     groups = {cracky=1, oddly_breakable_by_hand=1, dig_immediate=2, falling_node=1},
  111.     light_source = 5,
  112.     node_box = {
  113.         type = "fixed",
  114.         fixed = {
  115.             {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1
  116.             {-0.375, -0.4375, -0.375, 0.375, -0.3125, 0.375}, -- NodeBox2
  117.             {-0.4375, -0.3125, -0.375, 0.4375, 0.3125, 0.375}, -- NodeBox3
  118.             {-0.375, 0.3125, -0.375, 0.375, 0.4375, 0.375}, -- NodeBox4
  119.             {-0.3125, 0.4375, -0.3125, 0.3125, 0.5625, 0.3125}, -- NodeBox5
  120.             {-0.25, 0.5625, -0.25, 0.25, 0.6875, 0.25}, -- NodeBox6
  121.             {-0.1875, 0.6875, -0.1875, 0.1875, 0.75, 0.1875}, -- NodeBox7
  122.             {-0.125, 0.75, -0.125, 0.125, 0.8125, 0.125}, -- NodeBox8
  123.             {-0.375, -0.3125, -0.4375, 0.375, 0.3125, 0.4375}, -- NodeBox9
  124.         },
  125.     sounds = default.node_sound_wood_defaults()
  126.     }
  127. })
  128.  
  129. if minetest.get_modpath("scifi_mobs") then
  130. minetest.register_abm({
  131.     nodenames = {"scifi_nodes:egg"},
  132.     interval = 30, chance = 10,
  133.     action = function(pos, node, _, _)
  134.         minetest.env:add_entity(pos, "scifi_mobs:xenomorph")
  135.         minetest.env:remove_node(pos)
  136.     end
  137. })
  138. end
  139.  
  140. minetest.register_node("scifi_nodes:pad", {
  141.     description = "teleport pad",
  142.     tiles = {
  143.         "scifi_nodes_pad.png",
  144.         "scifi_nodes_pad.png",
  145.         "scifi_nodes_pad.png",
  146.         "scifi_nodes_pad.png",
  147.         "scifi_nodes_pad.png",
  148.         "scifi_nodes_pad.png"
  149.     },
  150.     drawtype = "nodebox",
  151.     paramtype = "light",
  152.     groups = {cracky=1, oddly_breakable_by_hand=1},
  153.     light_source = 5,
  154.     on_construct = function(pos, node, placer)
  155.         local meta = minetest.get_meta(pos)
  156.         if position1 == nil then
  157.         position1 = pos
  158.         meta:set_int("type", 1)
  159.         elseif position2 == nil then
  160.         position2 = pos
  161.         meta:set_int("type", 2)
  162.         else
  163.         minetest.chat_send_all("There can only be two teleportation pads at a time!")
  164.         end
  165.     end,
  166.     on_rightclick = function(pos, node, clicker)
  167.         local meta = minetest.get_meta(pos)
  168.         if meta:get_int("type") == 1 and position2 ~= nil and position1 ~= nil then
  169.         minetest.add_particlespawner(
  170.             25, --amount
  171.             1.5, --time
  172.             {x=pos.x-0.9, y=pos.y-0.3, z=pos.z-0.9}, --minpos
  173.             {x=pos.x+0.9, y=pos.y-0.3, z=pos.z+0.9}, --maxpos
  174.             {x=0, y=0, z=0}, --minvel
  175.             {x=0, y=0, z=0}, --maxvel
  176.             {x=-0,y=1,z=-0}, --minacc
  177.             {x=0,y=2,z=0}, --maxacc
  178.             0.5, --minexptime
  179.             1, --maxexptime
  180.             2, --minsize
  181.             5, --maxsize
  182.             false, --collisiondetection
  183.             "scifi_nodes_tp_part.png" --texture
  184.         )
  185.         minetest.after(1, function()
  186.         local ppos = clicker:getpos()
  187.         if minetest.get_node({x=ppos.x, y=ppos.y, z=ppos.z}).name == "scifi_nodes:pad" then
  188.         clicker:setpos(position2)
  189.         else
  190.         --minetest.chat_send_all("Nothing to teleport!")
  191.         end
  192.         local objs = minetest.env:get_objects_inside_radius(pos, 3)
  193.                 for _, obj in pairs(objs) do
  194.                 if obj:get_luaentity() and not obj:is_player() then
  195.                 if obj:get_luaentity().name == "__builtin:item" then
  196.                 local item1 = obj:get_luaentity().itemstring
  197.                 local obj2 = minetest.env:add_entity(position2, "__builtin:item")
  198.                 obj2:get_luaentity():set_item(item1)
  199.                 obj:remove()
  200.                 end
  201.                 end
  202.                 end
  203.         end)
  204.         elseif meta:get_int("type") == 2 and position1 ~= nil and position2 ~= nil then
  205.         minetest.add_particlespawner(
  206.             25, --amount
  207.             1.5, --time
  208.             {x=pos.x-0.9, y=pos.y-0.3, z=pos.z-0.9}, --minpos
  209.             {x=pos.x+0.9, y=pos.y-0.3, z=pos.z+0.9}, --maxpos
  210.             {x=0, y=0, z=0}, --minvel
  211.             {x=0, y=0, z=0}, --maxvel
  212.             {x=-0,y=1,z=-0}, --minacc
  213.             {x=0,y=2,z=0}, --maxacc
  214.             0.5, --minexptime
  215.             1, --maxexptime
  216.             2, --minsize
  217.             5, --maxsize
  218.             false, --collisiondetection
  219.             "scifi_nodes_tp_part.png" --texture
  220.         )
  221.         minetest.after(1, function()
  222.         local ppos = clicker:getpos()
  223.         if minetest.get_node({x=ppos.x, y=ppos.y, z=ppos.z}).name == "scifi_nodes:pad" then
  224.         clicker:setpos(position1)
  225.         else
  226.         --minetest.chat_send_all("No-one to teleport!")
  227.         end
  228.         local objs = minetest.env:get_objects_inside_radius(pos, 3)
  229.                 for _, obj in pairs(objs) do
  230.                 if obj:get_luaentity() and not obj:is_player() then
  231.                 if obj:get_luaentity().name == "__builtin:item" then
  232.                 local item1 = obj:get_luaentity().itemstring
  233.                 local obj2 = minetest.env:add_entity(position1, "__builtin:item")
  234.                 obj2:get_luaentity():set_item(item1)
  235.                 obj:remove()
  236.                 end
  237.                 end
  238.                 end
  239.         end)
  240.         elseif position1 == nil and meta:get_int("type") ~= 2 then
  241.         position1 = pos
  242.         meta:set_int("type", 1)
  243.         minetest.chat_send_all("Teleporter 1 connected at "..minetest.pos_to_string(pos))
  244.         elseif position2 == nil and meta:get_int("type") ~= 1 then
  245.         position2 = pos
  246.         meta:set_int("type", 2)
  247.         minetest.chat_send_all("Teleporter 2 connected at "..minetest.pos_to_string(pos))
  248.         else minetest.chat_send_all("Teleporter error!")
  249.         end
  250.     end,
  251.     on_destruct = function(pos, oldnode, placer)
  252.         local meta = minetest.get_meta(pos)
  253.         if meta:get_int("type") == 1 then
  254.         position1 = nil
  255.         meta:set_int("type", 0)
  256.         elseif meta:get_int("type") == 2 then
  257.         position2 = nil
  258.         meta:set_int("type", 0)
  259.         end
  260.     end,
  261.     node_box = {
  262.         type = "fixed",
  263.         fixed = {
  264.             {-0.9375, -0.5, -0.75, 0.875, -0.375, 0.75}, -- NodeBox1
  265.             {-0.8125, -0.5, -0.875, 0.75, -0.375, 0.875}, -- NodeBox2
  266.             {-0.875, -0.5, -0.8125, 0.8125, -0.375, 0.8125}, -- NodeBox3
  267.             {-0.8125, -0.5, -0.75, 0.75, -0.3125, 0.75}, -- NodeBox4
  268.         },
  269.     sounds = default.node_sound_wood_defaults()
  270.     }
  271. })
  272.  
  273. minetest.register_node("scifi_nodes:pplwndw", {
  274.     description = "Purple Window",
  275.     tiles = {
  276.         "scifi_nodes_purple.png",
  277.         "scifi_nodes_purple.png",
  278.         "scifi_nodes_purple.png",
  279.         "scifi_nodes_purple.png",
  280.         "scifi_nodes_pplwndw.png",
  281.         "scifi_nodes_pplwndw.png"
  282.     },
  283.     drawtype = "nodebox",
  284.     paramtype = "light",
  285.     paramtype2 = "facedir",
  286.     use_texture_alpha = true,
  287.     groups = {cracky=3},
  288.     sounds = default.node_sound_glass_defaults(),
  289.     node_box = {
  290.         type = "fixed",
  291.         fixed = {
  292.             {-0.5, -0.5, -0.0625, 0.5, 0.5, 0.0625}, -- NodeBox1
  293.         }
  294.     }
  295. })
  296.  
  297. minetest.register_node("scifi_nodes:gloshroom", {
  298.     description = "Gloshroom",
  299.     tiles = {
  300.         "scifi_nodes_gloshroom.png",
  301.         "scifi_nodes_gloshroom_under.png",
  302.         "scifi_nodes_gloshroom.png",
  303.         "scifi_nodes_gloshroom.png",
  304.         "scifi_nodes_gloshroom.png",
  305.         "scifi_nodes_gloshroom.png"
  306.     },
  307.     drawtype = "nodebox",
  308.     paramtype = "light",
  309.     light_source = default.LIGHT_MAX,
  310.     walkable = false,
  311.     buildable_to = true,
  312.     sunlight_propagates = false,
  313.     use_texture_alpha =  true,
  314.     groups = {fleshy=1, oddly_breakable_by_hand=1, dig_immediate=3},
  315.     node_box = {
  316.         type = "fixed",
  317.         fixed = {
  318.             {-0.05, -0.5, -0.05, 0.05, 0.0625, 0.05}, -- NodeBox1
  319.             {-0.4375, -0.0625, -0.375, 0.4375, 0, 0.375}, -- NodeBox2
  320.             {-0.375, 0, -0.375, 0.375, 0.0625, 0.375}, -- NodeBox3
  321.             {-0.3125, 0.0625, -0.3125, 0.3125, 0.125, 0.3125}, -- NodeBox4
  322.             {-0.1875, 0.125, -0.1875, 0.1875, 0.1875, 0.1875}, -- NodeBox5
  323.             {-0.375, -0.0625, -0.4375, 0.375, 0, 0.4375}, -- NodeBox6
  324.         }
  325.     }
  326. })
  327.  
  328. minetest.register_node("scifi_nodes:pot_lid", {
  329.     description = "plant pot lid(place above plant)",
  330.     tiles = {
  331.         "scifi_nodes_glass2.png",
  332.         "scifi_nodes_glass2.png",
  333.         "scifi_nodes_glass2.png",
  334.         "scifi_nodes_glass2.png",
  335.         "scifi_nodes_glass2.png",
  336.         "scifi_nodes_glass2.png"
  337.     },
  338.     inventory_image = "scifi_nodes_pod_inv.png",
  339.     wield_image = "scifi_nodes_pod_inv.png",
  340.     use_texture_alpha = true,
  341.     drawtype = "nodebox",
  342.     paramtype = "light",
  343.     groups = {cracky=1, not_in_creative_inventory=1},
  344.     sunlight_propagates = true,
  345.     selection_box = {
  346.         type = "fixed",
  347.         fixed = {0, 0, 0, 0, 0, 0}
  348.     },
  349.     collision_box = {
  350.         type = "fixed",
  351.         fixed = {-0.5, -1.5, -0.5, 0.5, -0.5, 0.5}
  352.     },
  353.     node_box = {
  354.         type = "fixed",
  355.         fixed = {
  356.             {-0.1875, -0.5625, -0.1875, 0.1875, -0.5, 0.1875}, -- NodeBox13
  357.             {-0.25, -0.625, -0.25, 0.25, -0.5625, 0.25}, -- NodeBox14
  358.             {-0.3125, -0.6875, -0.3125, 0.3125, -0.625, 0.3125}, -- NodeBox15
  359.             {-0.375, -0.75, -0.375, 0.375, -0.6875, 0.375}, -- NodeBox16
  360.             {-0.4375, -0.75, 0.375, 0.4375, -1.5, 0.4375}, -- NodeBox17
  361.             {-0.4375, -0.75, -0.4375, 0.4375, -1.5, -0.375}, -- NodeBox18
  362.             {0.375, -0.75, -0.4375, 0.4375, -1.5, 0.4375}, -- NodeBox19
  363.             {-0.4375, -0.75, -0.4375, -0.375, -1.5, 0.4375}, -- NodeBox20
  364.         }
  365.     },
  366.     sounds = default.node_sound_glass_defaults()
  367. })
  368.  
  369. minetest.register_node("scifi_nodes:pot", {
  370.     description = "metal plant pot (right click for lid, shift+rightclick to plant)",
  371.     tiles = {
  372.         "scifi_nodes_pot.png",
  373.         "scifi_nodes_greybolts.png",
  374.         "scifi_nodes_greybolts.png",
  375.         "scifi_nodes_greybolts.png",
  376.         "scifi_nodes_greybolts.png",
  377.         "scifi_nodes_greybolts.png"
  378.     },
  379.     drawtype = "nodebox",
  380.     paramtype = "light",
  381.     groups = {cracky=1, soil=1, sand=1},
  382.     node_box = {
  383.         type = "fixed",
  384.         fixed = {
  385.             {-0.5, -0.25, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
  386.             {0.1875, -0.5, 0.1875, 0.5, -0.25, 0.5}, -- NodeBox2
  387.             {-0.5, -0.5, -0.5, -0.1875, -0.25, -0.1875}, -- NodeBox3
  388.             {-0.5, -0.5, 0.1875, -0.1875, -0.25, 0.5}, -- NodeBox4
  389.             {0.1875, -0.5, -0.5, 0.5, -0.25, -0.1875}, -- NodeBox5
  390.         }
  391.     },
  392.     on_rightclick = function(pos, node, clicker, item, _)
  393.     local node = minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z})
  394.     if node.name == "scifi_nodes:pot_lid" then
  395.         minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="air", param2=node.param2})
  396.     elseif node.name ~= "scifi_nodes:pot_lid" and node.name == "air" then
  397.         minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="scifi_nodes:pot_lid", param2=node.param2})
  398.     end
  399.     end,
  400.     on_destruct = function(pos, node, _)
  401.         minetest.remove_node({x=pos.x, y=pos.y+2, z=pos.z})
  402.     end
  403. })
  404.  
  405. minetest.register_node("scifi_nodes:pot2", {
  406.     description = "metal wet plant pot(right click for lid, shift+rightclick to plant)",
  407.     tiles = {
  408.         "scifi_nodes_pot.png^[colorize:black:100",
  409.         "scifi_nodes_greybolts.png",
  410.         "scifi_nodes_greybolts.png",
  411.         "scifi_nodes_greybolts.png",
  412.         "scifi_nodes_greybolts.png",
  413.         "scifi_nodes_greybolts.png"
  414.     },
  415.     drawtype = "nodebox",
  416.     paramtype = "light",
  417.     groups = {cracky=1, soil=3, wet=1},
  418.     node_box = {
  419.         type = "fixed",
  420.         fixed = {
  421.             {-0.5, -0.25, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
  422.             {0.1875, -0.5, 0.1875, 0.5, -0.25, 0.5}, -- NodeBox2
  423.             {-0.5, -0.5, -0.5, -0.1875, -0.25, -0.1875}, -- NodeBox3
  424.             {-0.5, -0.5, 0.1875, -0.1875, -0.25, 0.5}, -- NodeBox4
  425.             {0.1875, -0.5, -0.5, 0.5, -0.25, -0.1875}, -- NodeBox5
  426.         }
  427.     },
  428.     on_rightclick = function(pos, node, clicker, item, _)
  429.     local node = minetest.get_node({x=pos.x, y=pos.y+2, z=pos.z})
  430.     if node.name == "scifi_nodes:pot_lid" then
  431.         minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="air", param2=node.param2})
  432.     elseif node.name ~= "scifi_nodes:pot_lid" and node.name == "air" then
  433.         minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z}, {name="scifi_nodes:pot_lid", param2=node.param2})
  434.     end
  435.     end,
  436.     on_destruct = function(pos, node, _)
  437.         minetest.remove_node({x=pos.x, y=pos.y+2, z=pos.z})
  438.     end
  439. })
  440.  
  441. minetest.register_node("scifi_nodes:lightbar", {
  442.     description = "ceiling light",
  443.     tiles = {
  444.         "scifi_nodes_white2.png",
  445.     },
  446.     drawtype = "nodebox",
  447.     paramtype = "light",
  448.     paramtype2 = "wallmounted",
  449.     sunlight_propagates = true,
  450.     light_source = default.LIGHT_MAX,
  451.     node_box = {
  452.         type = "fixed",
  453.         fixed = {
  454.             {-0.125, -0.5, -0.5, 0.125, -0.375, 0.5}, -- NodeBox1
  455.         }
  456.     },
  457.     selection_box = {
  458.         type = "wallmounted",
  459.         wallmounted = {
  460.             {-0.125, -0.5, -0.5, 0.125, -0.375, 0.5}, -- NodeBox1
  461.         }
  462.     },
  463.     groups = {cracky=1},
  464.     sounds = default.node_sound_glass_defaults()
  465. })
  466.  
  467. minetest.register_node("scifi_nodes:light_dynamic", {
  468.     description = "Wall light",
  469.     tiles = {
  470.         "scifi_nodes_lightoverlay.png",
  471.     },
  472.     inventory_image = "scifi_nodes_lightoverlay.png",
  473.     wield_image = "scifi_nodes_lightoverlay.png",
  474.     drawtype = "signlike",
  475.     paramtype = "light",
  476.     selection_box = {
  477.         type = "wallmounted",
  478.         fixed = {-0.5, -0.5, -0.5, -0.45, 0.5, 0.5}
  479.     },
  480.     paramtype2 = "wallmounted",
  481.     light_source = default.LIGHT_MAX,
  482.     groups = {cracky=1, oddly_breakable_by_hand=1},
  483.     sounds = default.node_sound_glass_defaults()
  484. })
  485.  
  486. minetest.register_node("scifi_nodes:ladder", {
  487.     description = "Metal Ladder",
  488.     tiles = {
  489.         "scifi_nodes_ladder.png",
  490.     },
  491.     drawtype = "nodebox",
  492.     paramtype = "light",
  493.     selection_box = {
  494.         type = "wallmounted",
  495.         fixed = {-0.5, -0.5, -0.5, -0.45, 0.5, 0.5}
  496.     },
  497.     node_box = {
  498.         type = "fixed",
  499.         fixed = {
  500.             {0.3125, -0.5, -0.4375, 0.4375, -0.375, -0.3125}, -- NodeBox12
  501.             {-0.4375, -0.5, -0.4375, -0.3125, -0.375, -0.3125}, -- NodeBox13
  502.             {-0.375, -0.375, -0.4375, 0.375, -0.3125, -0.3125}, -- NodeBox14
  503.             {-0.375, -0.375, 0.3125, 0.375, -0.3125, 0.4375}, -- NodeBox18
  504.             {-0.375, -0.375, 0.0625, 0.375, -0.3125, 0.1875}, -- NodeBox19
  505.             {-0.375, -0.375, -0.1875, 0.375, -0.3125, -0.0625}, -- NodeBox20
  506.             {-0.4375, -0.5, -0.1875, -0.3125, -0.375, -0.0625}, -- NodeBox21
  507.             {-0.4375, -0.5, 0.0625, -0.3125, -0.375, 0.1875}, -- NodeBox22
  508.             {-0.4375, -0.5, 0.3125, -0.3125, -0.375, 0.4375}, -- NodeBox23
  509.             {0.3125, -0.5, 0.3125, 0.4375, -0.375, 0.4375}, -- NodeBox24
  510.             {0.3125, -0.5, 0.0625, 0.4375, -0.375, 0.1875}, -- NodeBox25
  511.             {0.3125, -0.5, -0.1875, 0.4375, -0.375, -0.0625}, -- NodeBox26
  512.         },
  513.     sounds = default.node_sound_metal_defaults()
  514.     },
  515.     paramtype2 = "wallmounted",
  516.     walkable = false,
  517.     climbable = true,
  518.     groups = {cracky=1, oddly_breakable_by_hand=1},
  519. })
  520.  
  521. minetest.register_node("scifi_nodes:lightbars", {
  522.     description = "orange lightbars",
  523.     tiles = {
  524.         "scifi_nodes_orange2.png",
  525.     },
  526.     drawtype = "nodebox",
  527.     paramtype = "light",
  528.     use_texture_alpha = true,
  529.     light_source = default.LIGHT_MAX,
  530.     node_box = {
  531.         type = "fixed",
  532.         fixed = {
  533.             {0.125, -0.5, 0.125, 0.375, 0.5, 0.375}, -- NodeBox1
  534.             {-0.375, -0.5, 0.125, -0.125, 0.5, 0.375}, -- NodeBox2
  535.             {-0.375, -0.5, -0.375, -0.125, 0.5, -0.125}, -- NodeBox3
  536.             {0.125, -0.5, -0.375, 0.375, 0.5, -0.125}, -- NodeBox4
  537.         }
  538.     },
  539.     groups = {cracky=1},
  540.     sounds = default.node_sound_glass_defaults()
  541. })
  542.  
  543. minetest.register_node("scifi_nodes:liquid_pipe", {
  544.     description = "Liquid pipe",
  545. tiles = {{
  546.         name = "scifi_nodes_liquid.png",
  547.         animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1.00},
  548.     }},
  549.     use_texture_alpha = true,
  550.     light_source = default.LIGHT_MAX,
  551.     drawtype = "nodebox",
  552.     sunlight_propagates = true,
  553.     paramtype = "light",
  554.     node_box = {
  555.         type = "fixed",
  556.         fixed = {
  557.             {-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}, -- NodeBox1
  558.         }
  559.     },
  560.     groups = {cracky=1, oddly_breakable_by_hand=1},
  561.     sounds = default.node_sound_glass_defaults()
  562. })
  563.  
  564. minetest.register_node("scifi_nodes:liquid_pipe2", {
  565.     description = "Liquid pipe 2",
  566. tiles = {
  567.         "scifi_nodes_orange.png",
  568.     },
  569.     use_texture_alpha = true,
  570.     light_source = default.LIGHT_MAX,
  571.     drawtype = "nodebox",
  572.     sunlight_propagates = true,
  573.     paramtype = "light",
  574.     node_box = {
  575.         type = "fixed",
  576.         fixed = {
  577.             {-0.375, -0.5, -0.375, 0.375, 0.5, 0.375}, -- NodeBox1
  578.         }
  579.     },
  580.     groups = {cracky=1, oddly_breakable_by_hand=1},
  581.     sounds = default.node_sound_glass_defaults()
  582. })
  583.  
  584. minetest.register_node("scifi_nodes:powered_stand", {
  585.     description = "powered stand",
  586.     tiles = {
  587.         "scifi_nodes_pwrstnd_top.png",
  588.         "scifi_nodes_pwrstnd_top.png",
  589.         "scifi_nodes_pwrstnd_side.png",
  590.         "scifi_nodes_pwrstnd_side.png",
  591.         "scifi_nodes_pwrstnd_side.png",
  592.         "scifi_nodes_pwrstnd_side.png"
  593.     },
  594.     drawtype = "nodebox",
  595.     paramtype = "light",
  596.     node_box = {
  597.         type = "fixed",
  598.         fixed = {
  599.             {-0.375, 0.25, -0.3125, 0.375, 0.4375, 0.3125}, -- NodeBox1
  600.             {-0.3125, 0.25, -0.375, 0.3125, 0.4375, 0.375}, -- NodeBox2
  601.             {-0.3125, 0.4375, -0.3125, 0.3125, 0.5, 0.3125}, -- NodeBox3
  602.             {-0.5, -0.5, -0.125, 0.5, 0.125, 0.125}, -- NodeBox4
  603.             {-0.125, -0.5, -0.5, 0.125, 0.125, 0.5}, -- NodeBox5
  604.             {-0.4375, 0.125, -0.125, 0.4375, 0.25, 0.125}, -- NodeBox6
  605.             {-0.125, 0.125, -0.4375, 0.125, 0.25, 0.4375}, -- NodeBox7
  606.             {-0.3125, -0.5, -0.375, 0.3125, 0.0625, 0.3125}, -- NodeBox8
  607.             {-0.25, 0.0625, -0.3125, 0.25, 0.125, 0.3125}, -- NodeBox9
  608.         }
  609.     },
  610.     groups = {cracky=1, oddly_breakable_by_hand=1},
  611.     on_rightclick = function(pos, node, clicker, item, _)
  612.         local wield_item = clicker:get_wielded_item():get_name()
  613.         item:take_item()
  614.         minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, wield_item)
  615.     end,
  616. })
  617.  
  618. minetest.register_node("scifi_nodes:cover", {
  619.     description = "Metal cover",
  620.     tiles = {
  621.         "scifi_nodes_pwrstnd_top.png",
  622.         "scifi_nodes_pwrstnd_top.png",
  623.         "scifi_nodes_pwrstnd_top.png",
  624.         "scifi_nodes_pwrstnd_top.png",
  625.         "scifi_nodes_pwrstnd_top.png",
  626.         "scifi_nodes_pwrstnd_top.png"
  627.     },
  628.     drawtype = "nodebox",
  629.     paramtype = "light",
  630.     node_box = {
  631.         type = "fixed",
  632.         fixed = {
  633.             {-0.375, -0.5, -0.3125, 0.375, -0.375, 0.3125}, -- NodeBox1
  634.             {-0.3125, -0.5, -0.375, 0.3125, -0.375, 0.375}, -- NodeBox5
  635.             {-0.3125, -0.375, -0.3125, 0.3125, -0.3125, 0.3125}, -- NodeBox6
  636.         }
  637.     },
  638.     sounds = default.node_sound_wood_defaults(),
  639.     groups = {cracky=1, oddly_breakable_by_hand=1}
  640. })
  641.  
  642. minetest.register_node("scifi_nodes:computer", {
  643.     description = "computer",
  644.     tiles = {
  645.         "scifi_nodes_black.png",
  646.         "scifi_nodes_black.png",
  647.         "scifi_nodes_blackvent.png",
  648.         "scifi_nodes_black.png",
  649.         "scifi_nodes_mesh2.png",
  650.         "scifi_nodes_pc.png"
  651.     },
  652.     drawtype = "nodebox",
  653.     paramtype = "light",
  654.     paramtype2 = "facedir",
  655.     sunlight_propagates = true,
  656.     node_box = {
  657.         type = "fixed",
  658.         fixed = {
  659.             {-0.4375, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox1
  660.         }
  661.     },
  662.     groups = {cracky=1, oddly_breakable_by_hand=1}
  663. })
  664.  
  665. minetest.register_node("scifi_nodes:keysmonitor", {
  666.     description = "Keyboard and monitor",
  667.     tiles = {
  668.         "scifi_nodes_keyboard.png",
  669.         "scifi_nodes_black.png",
  670.         "scifi_nodes_black.png",
  671.         "scifi_nodes_black.png",
  672.         "scifi_nodes_black.png",
  673.         "scifi_nodes_monitor.png"
  674.     },
  675.     drawtype = "nodebox",
  676.     paramtype = "light",
  677.     sunlight_propagates = true,
  678.     paramtype2 = "facedir",
  679.     node_box = {
  680.         type = "fixed",
  681.         fixed = {
  682.             {-0.5, -0.5, -0.4375, 0.5, -0.4375, -0.0625}, -- NodeBox1
  683.             {-0.125, -0.5, 0.375, 0.125, 0.0625, 0.4375}, -- NodeBox2
  684.             {-0.25, -0.5, 0.125, 0.25, -0.4375, 0.5}, -- NodeBox3
  685.             {-0.5, -0.3125, 0.25, 0.5, 0.5, 0.375}, -- NodeBox4
  686.         }
  687.     },
  688.     groups = {cracky=1, oddly_breakable_by_hand=1}
  689. })
  690.  
  691. minetest.register_node("scifi_nodes:microscope", {
  692.     description = "Microscope",
  693.     tiles = {
  694.         "scifi_nodes_white.png",
  695.         "scifi_nodes_black.png",
  696.         "scifi_nodes_white_vent.png",
  697.         "scifi_nodes_white_vent.png",
  698.         "scifi_nodes_white_vent.png",
  699.         "scifi_nodes_white_vent.png"
  700.     },
  701.     drawtype = "nodebox",
  702.     paramtype = "light",
  703.     paramtype2 = "facedir",
  704.     sunlight_propagates = true,
  705.     node_box = {
  706.         type = "fixed",
  707.         fixed = {
  708.             {-0.25, -0.5, -0.3125, 0.25, -0.375, 0.3125}, -- NodeBox1
  709.             {-0.0625, -0.5, 0.125, 0.0625, 0.3125, 0.25}, -- NodeBox2
  710.             {-0.0625, -0.0625, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox3
  711.             {-0.0625, 0.0625, 0.0625, 0.0625, 0.25, 0.125}, -- NodeBox4
  712.             {-0.125, -0.25, -0.125, 0.125, -0.1875, 0.1875}, -- NodeBox5
  713.         }
  714.     },
  715.     groups = {cracky=1, oddly_breakable_by_hand=1}
  716. })
  717.  
  718. minetest.register_node("scifi_nodes:table", {
  719.     description = "Metal table",
  720.     tiles = {
  721.         "scifi_nodes_grey.png",
  722.         "scifi_nodes_grey.png",
  723.         "scifi_nodes_grey.png",
  724.         "scifi_nodes_grey.png",
  725.         "scifi_nodes_grey.png",
  726.         "scifi_nodes_grey.png"
  727.     },
  728.     drawtype = "nodebox",
  729.     paramtype = "light",
  730.     paramtype2 = "facedir",
  731.     node_box = {
  732.         type = "fixed",
  733.         fixed = {
  734.             {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox1
  735.             {-0.0625, -0.5, 0.125, 0.0625, 0.5, 0.3125}, -- NodeBox2
  736.             {-0.0625, -0.5, 0.375, 0.0625, 0.5, 0.4375}, -- NodeBox3
  737.             {-0.0625, -0.375, 0.0625, 0.0625, 0.4375, 0.125}, -- NodeBox4
  738.             {-0.0625, -0.1875, 0, 0.0625, 0.4375, 0.0625}, -- NodeBox5
  739.             {-0.0625, 0.0625, -0.0625, 0.0625, 0.4375, 0}, -- NodeBox6
  740.             {-0.0625, 0.25, -0.125, 0.0625, 0.4375, -0.0625}, -- NodeBox7
  741.         }
  742.     },
  743.     sounds = default.node_sound_metal_defaults(),
  744.     groups = {cracky=1}
  745. })
  746.  
  747. minetest.register_node("scifi_nodes:laptop_open", {
  748.     description = "laptop",
  749.     tiles = {
  750.         "scifi_nodes_lapkey.png",
  751.         "scifi_nodes_black.png",
  752.         "scifi_nodes_black.png",
  753.         "scifi_nodes_black.png",
  754.         "scifi_nodes_black.png",
  755.         "scifi_nodes_laptop.png"
  756.     },
  757.     drawtype = "nodebox",
  758.     paramtype = "light",
  759.     paramtype2 = "facedir",
  760.     sunlight_propagates = true,
  761.     node_box = {
  762.         type = "fixed",
  763.         fixed = {
  764.             {-0.4375, -0.5, -0.4375, 0.4375, -0.375, 0.3125}, -- NodeBox1
  765.             {-0.4375, -0.375, 0.3125, 0.4375, 0.4375, 0.4375}, -- NodeBox11
  766.         }
  767.     },
  768.     groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  769.     on_rightclick = function(pos, node, clicker, item, _)
  770.             minetest.set_node(pos, {name="scifi_nodes:laptop_closed", param2=node.param2})
  771.     end,
  772. })
  773.  
  774. minetest.register_node("scifi_nodes:laptop_closed", {
  775.     description = "laptop",
  776.     tiles = {
  777.         "scifi_nodes_black.png",
  778.         "scifi_nodes_black.png",
  779.         "scifi_nodes_black.png",
  780.         "scifi_nodes_black.png",
  781.         "scifi_nodes_black.png",
  782.         "scifi_nodes_black.png"
  783.     },
  784.     drawtype = "nodebox",
  785.     paramtype = "light",
  786.     paramtype2 = "facedir",
  787.     sunlight_propagates = true,
  788.     node_box = {
  789.         type = "fixed",
  790.         fixed = {
  791.             {-0.4375, -0.5, -0.4375, 0.4375, -0.25, 0.3125}, -- NodeBox1
  792.         }
  793.     },
  794.     groups = {cracky=1, oddly_breakable_by_hand=1},
  795.     on_rightclick = function(pos, node, clicker, item, _)
  796.             minetest.set_node(pos, {name="scifi_nodes:laptop_open", param2=node.param2})
  797.     end,
  798. })
  799.  
  800. minetest.register_node("scifi_nodes:pipen", {
  801.     description = "pipe(nodebox)",
  802.     tiles = {
  803.         "scifi_nodes_blacktile2.png",
  804.         "scifi_nodes_blacktile2.png",
  805.         "scifi_nodes_pipen.png",
  806.         "scifi_nodes_pipen.png",
  807.         "scifi_nodes_pipen.png",
  808.         "scifi_nodes_pipen.png"
  809.     },
  810.     drawtype = "nodebox",
  811.     paramtype = "light",
  812.     paramtype2 = "facedir",
  813.     node_box = {
  814.         type = "fixed",
  815.         fixed = {
  816.             {-0.4375, -0.5, -0.4375, 0.4375, 0.5, 0.4375}, -- NodeBox1
  817.             {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, -- NodeBox2
  818.             {-0.5, 0.3125, -0.5, 0.5, 0.375, 0.5}, -- NodeBox3
  819.             {-0.5, 0.1875, -0.5, 0.5, 0.25, 0.5}, -- NodeBox4
  820.             {-0.5, 0.0625, -0.5, 0.5, 0.125, 0.5}, -- NodeBox5
  821.             {-0.5, -0.0625, -0.5, 0.5, 0, 0.5}, -- NodeBox6
  822.             {-0.5, -0.1875, -0.5, 0.5, -0.125, 0.5}, -- NodeBox7
  823.             {-0.5, -0.3125, -0.5, 0.5, -0.25, 0.5}, -- NodeBox8
  824.             {-0.5, -0.4375, -0.5, 0.5, -0.375, 0.5}, -- NodeBox9
  825.         }
  826.     },
  827.     groups = {cracky=1},
  828.     on_place = minetest.rotate_node
  829. })
  830.  
  831. minetest.register_node("scifi_nodes:windowcorner", {
  832.     description = "strong window corner",
  833.     tiles = {
  834.         "scifi_nodes_glassstrngsd2.png",
  835.         "scifi_nodes_white.png",
  836.         "scifi_nodes_glassstrngcrnr.png",
  837.         "scifi_nodes_glassstrngcrnr2.png",
  838.         "scifi_nodes_white.png",
  839.         "scifi_nodes_glassstrngsd.png"
  840.     },
  841.     drawtype = "nodebox",
  842.     paramtype = "light",
  843.     use_texture_alpha = true,
  844.     sunlight_propagates = true,
  845.     paramtype2 = "facedir",
  846.     node_box = {
  847.         type = "fixed",
  848.         fixed = {
  849.             {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox1
  850.             {-0.3125, -0.25, 0.25, 0.3125, -0.1875, 0.5}, -- NodeBox7
  851.             {-0.3125, -0.25, 0.3125, 0.3125, -0.125, 0.375}, -- NodeBox8
  852.             {-0.3125, -0.3125, 0.25, 0.3125, -0.1875, 0.3125}, -- NodeBox9
  853.             {-0.3125, -0.5, 0.375, 0.3125, 0.5, 0.5}, -- NodeBox10
  854.             {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  855.         }
  856.     },
  857.     groups = {cracky=1},
  858.     on_place = minetest.rotate_node,
  859.     sounds = default.node_sound_glass_defaults(),
  860. })
  861.  
  862. minetest.register_node("scifi_nodes:windowstraight", {
  863.     description = "strong window",
  864.     tiles = {
  865.         "scifi_nodes_glassstrngsd2.png",
  866.         "scifi_nodes_white.png",
  867.         "scifi_nodes_glassstrng.png",
  868.         "scifi_nodes_glassstrng.png",
  869.         "scifi_nodes_glassstrngsd.png",
  870.         "scifi_nodes_glassstrngsd.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}, -- NodeBox10
  881.             {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  882.         }
  883.     },
  884.     groups = {cracky=1},
  885.     on_place = minetest.rotate_node,
  886.     sounds = default.node_sound_glass_defaults(),
  887. })
  888.  
  889. minetest.register_node("scifi_nodes:windowcorner2", {
  890.     description = "strong window corner(black)",
  891.     tiles = {
  892.         "scifi_nodes_glassstrngsd4.png",
  893.         "scifi_nodes_black.png",
  894.         "scifi_nodes_glassstrngcrnr3.png",
  895.         "scifi_nodes_glassstrngcrnr4.png",
  896.         "scifi_nodes_black.png",
  897.         "scifi_nodes_glassstrngsd3.png"
  898.     },
  899.     drawtype = "nodebox",
  900.     paramtype = "light",
  901.     use_texture_alpha = true,
  902.     sunlight_propagates = true,
  903.     paramtype2 = "facedir",
  904.     node_box = {
  905.         type = "fixed",
  906.         fixed = {
  907.             {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox1
  908.             {-0.3125, -0.25, 0.25, 0.3125, -0.1875, 0.5}, -- NodeBox7
  909.             {-0.3125, -0.25, 0.3125, 0.3125, -0.125, 0.375}, -- NodeBox8
  910.             {-0.3125, -0.3125, 0.25, 0.3125, -0.1875, 0.3125}, -- NodeBox9
  911.             {-0.3125, -0.5, 0.375, 0.3125, 0.5, 0.5}, -- NodeBox10
  912.             {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  913.         }
  914.     },
  915.     groups = {cracky=1},
  916.     on_place = minetest.rotate_node,
  917.     sounds = default.node_sound_glass_defaults(),
  918. })
  919.  
  920. minetest.register_node("scifi_nodes:windowstraight2", {
  921.     description = "strong window(black)",
  922.     tiles = {
  923.         "scifi_nodes_glassstrngsd4.png",
  924.         "scifi_nodes_black.png",
  925.         "scifi_nodes_glassstrng2.png",
  926.         "scifi_nodes_glassstrng2.png",
  927.         "scifi_nodes_glassstrngsd3.png",
  928.         "scifi_nodes_glassstrngsd3.png"
  929.     },
  930.     drawtype = "nodebox",
  931.     paramtype = "light",
  932.     use_texture_alpha = true,
  933.     sunlight_propagates = true,
  934.     paramtype2 = "facedir",
  935.     node_box = {
  936.         type = "fixed",
  937.         fixed = {
  938.             {-0.3125, -0.5, -0.5, 0.3125, -0.25, 0.5}, -- NodeBox10
  939.             {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  940.         }
  941.     },
  942.     groups = {cracky=1},
  943.     on_place = minetest.rotate_node,
  944.     sounds = default.node_sound_glass_defaults(),
  945. })
  946.  
  947.  
  948.  
  949. minetest.register_node("scifi_nodes:capsule", {
  950.     description = "sample capsule",
  951.     tiles = {
  952.         "scifi_nodes_capsule.png",
  953.         "scifi_nodes_capsule.png",
  954.         "scifi_nodes_box_top.png",
  955.         "scifi_nodes_box_top.png",
  956.         "scifi_nodes_capsule.png",
  957.         "scifi_nodes_capsule.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},
  973.     sounds = default.node_sound_glass_defaults(),
  974.     on_rightclick = function(pos, node, clicker, item, _)
  975.             minetest.set_node(pos, {name="scifi_nodes:capsule2", param2=node.param2})
  976.     end,
  977. })
  978.  
  979. minetest.register_node("scifi_nodes:capsule3", {
  980.     description = "sample capsule",
  981.     tiles = {
  982.         "scifi_nodes_capsule3.png",
  983.         "scifi_nodes_capsule3.png",
  984.         "scifi_nodes_box_top.png",
  985.         "scifi_nodes_box_top.png",
  986.         "scifi_nodes_capsule3.png",
  987.         "scifi_nodes_capsule3.png"
  988.     },
  989.     use_texture_alpha = true,
  990.     drawtype = "nodebox",
  991.     paramtype = "light",
  992.     paramtype2 = "facedir",
  993.     sunlight_propagates = true,
  994.     node_box = {
  995.         type = "fixed",
  996.         fixed = {
  997.             {0.3125, -0.5, -0.25, 0.5, 0, 0.25}, -- NodeBox1
  998.             {-0.5, -0.5, -0.25, -0.3125, 0, 0.25}, -- NodeBox2
  999.             {-0.3125, -0.4375, -0.1875, 0.3125, -0.0625, 0.1875}, -- NodeBox3
  1000.         }
  1001.     },
  1002.     groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  1003.     sounds = default.node_sound_glass_defaults(),
  1004.     on_rightclick = function(pos, node, clicker, item, _)
  1005.             minetest.set_node(pos, {name="scifi_nodes:capsule", param2=node.param2})
  1006.     end,
  1007. })
  1008.  
  1009. minetest.register_node("scifi_nodes:capsule2", {
  1010.     description = "sample capsule",
  1011.     tiles = {
  1012.         "scifi_nodes_capsule2.png",
  1013.         "scifi_nodes_capsule2.png",
  1014.         "scifi_nodes_box_top.png",
  1015.         "scifi_nodes_box_top.png",
  1016.         "scifi_nodes_capsule2.png",
  1017.         "scifi_nodes_capsule2.png"
  1018.     },
  1019.     use_texture_alpha = true,
  1020.     drawtype = "nodebox",
  1021.     paramtype = "light",
  1022.     paramtype2 = "facedir",
  1023.     sunlight_propagates = true,
  1024.     node_box = {
  1025.         type = "fixed",
  1026.         fixed = {
  1027.             {0.3125, -0.5, -0.25, 0.5, 0, 0.25}, -- NodeBox1
  1028.             {-0.5, -0.5, -0.25, -0.3125, 0, 0.25}, -- NodeBox2
  1029.             {-0.3125, -0.4375, -0.1875, 0.3125, -0.0625, 0.1875}, -- NodeBox3
  1030.         }
  1031.     },
  1032.     groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  1033.     sounds = default.node_sound_glass_defaults(),
  1034.     on_rightclick = function(pos, node, clicker, item, _)
  1035.             minetest.set_node(pos, {name="scifi_nodes:capsule3", param2=node.param2})
  1036.     end,
  1037. })
  1038.  
  1039. minetest.register_node("scifi_nodes:itemholder", {
  1040.     description = "item holder",
  1041.     tiles = {
  1042.         "scifi_nodes_box_top.png",
  1043.         "scifi_nodes_box_top.png",
  1044.         "scifi_nodes_box_top.png",
  1045.         "scifi_nodes_box_top.png",
  1046.         "scifi_nodes_box_top.png",
  1047.         "scifi_nodes_box_top.png"
  1048.     },
  1049.     drawtype = "nodebox",
  1050.     paramtype = "light",
  1051.     sunlight_propagates = true,
  1052.     node_box = {
  1053.         type = "fixed",
  1054.         fixed = {
  1055.             {-0.3125, -0.5, -0.3125, 0.3125, -0.25, 0.3125}, -- NodeBox1
  1056.             {-0.0625, -0.5, 0.1875, 0.0625, -0.0625, 0.25}, -- NodeBox2
  1057.             {-0.0625, -0.5, -0.25, 0.0625, -0.0625, -0.1875}, -- NodeBox3
  1058.             {0.1875, -0.5, -0.0625, 0.25, -0.0625, 0.0625}, -- NodeBox4
  1059.             {-0.25, -0.5, -0.0625, -0.1875, -0.0625, 0.0625}, -- NodeBox5
  1060.         }
  1061.     },
  1062.     groups = {cracky=1},
  1063.     on_rotate = screwdriver.disallow,
  1064.     after_place_node = function(pos, placer, itemstack)
  1065.         local meta = minetest.get_meta(pos)
  1066.         meta:set_string("owner",placer:get_player_name())
  1067.         meta:set_string("infotext", "Itemholder (owned by " ..
  1068.                 meta:get_string("owner") .. ")")
  1069.     end,
  1070.     on_rightclick = function(pos, node, clicker, item, _)
  1071.         local name = clicker and clicker:get_player_name()
  1072.         local meta = minetest.get_meta(pos)
  1073.         if name == meta:get_string("owner") or
  1074.                 minetest.check_player_privs(name, "protection_bypass") then
  1075.             local wield_item = clicker:get_wielded_item():get_name()
  1076.             item:take_item()
  1077.             minetest.add_item(pos, wield_item)
  1078.         end
  1079.     end,
  1080.     can_dig = function(pos,player)
  1081.         if not player then return end
  1082.         local name = player and player:get_player_name()
  1083.         local meta = minetest.get_meta(pos)
  1084.         return name == meta:get_string("owner") or
  1085.                 minetest.check_player_privs(name, "protection_bypass")
  1086.     end,
  1087.     on_destruct = function(pos)
  1088.         local meta = minetest.get_meta(pos)
  1089.         local node = minetest.get_node(pos)
  1090.         if meta:get_string("item") ~= "" then
  1091.             drop_item(pos, node)
  1092.         end
  1093.     end,
  1094. })
  1095.  
  1096. minetest.register_node("scifi_nodes:glassscreen", {
  1097.     description = "glass screen",
  1098.     tiles = {
  1099.         "scifi_nodes_glscrn.png",
  1100.         "scifi_nodes_glscrn.png",
  1101.         "scifi_nodes_glscrn.png",
  1102.         "scifi_nodes_glscrn.png",
  1103.         "scifi_nodes_glscrn.png",
  1104.         "scifi_nodes_glscrn.png"
  1105.     },
  1106.     use_texture_alpha = true,
  1107.     drawtype = "nodebox",
  1108.     paramtype = "light",
  1109.     paramtype2 = "facedir",
  1110.     light_source = default.LIGHT_MAX,
  1111.     sunlight_propagates = true,
  1112.     node_box = {
  1113.         type = "fixed",
  1114.         fixed = {
  1115.             {-0.4375, -0.5, -0.125, 0.4375, -0.1875, 0.0625}, -- NodeBox1
  1116.             {-0.375, -0.5, -0.0625, 0.375, 0.5, 0}, -- NodeBox10
  1117.         }
  1118.     },
  1119.     groups = {cracky=1, oddly_breakable_by_hand=1},
  1120.     sounds = default.node_sound_glass_defaults(),
  1121. })
  1122.  
  1123.  
  1124. minetest.register_node("scifi_nodes:widescreen", {
  1125.     description = "widescreen",
  1126.     tiles = {
  1127.         "scifi_nodes_black.png",
  1128.         "scifi_nodes_black.png",
  1129.         "scifi_nodes_black.png",
  1130.         "scifi_nodes_black.png",
  1131.         "scifi_nodes_black.png",
  1132.         "scifi_nodes_widescreen.png"
  1133.     },
  1134.     drawtype = "nodebox",
  1135.     paramtype = "light",
  1136.     light_source = 5,
  1137.     paramtype2 = "facedir",
  1138.     sunlight_propagates = true,
  1139.     node_box = {
  1140.         type = "fixed",
  1141.         fixed = {
  1142.             {-0.375, -0.3125, 0.4375, 0.375, 0.3125, 0.5}, -- NodeBox1
  1143.             {-0.5, -0.375, 0.375, -0.375, 0.375, 0.5}, -- NodeBox2
  1144.             {0.375, -0.375, 0.375, 0.5, 0.375, 0.5}, -- NodeBox3
  1145.             {-0.3125, 0.25, 0.375, 0.3125, 0.375, 0.5}, -- NodeBox4
  1146.             {-0.3125, -0.375, 0.375, 0.25, -0.25, 0.5}, -- NodeBox5
  1147.             {-0.5, -0.3125, 0.375, 0.5, -0.25, 0.5}, -- NodeBox6
  1148.             {-0.5, 0.25, 0.375, 0.5, 0.3125, 0.5}, -- NodeBox7
  1149.         }
  1150.     },
  1151.     groups = {cracky=1, oddly_breakable_by_hand=1}
  1152. })
  1153.  
  1154. minetest.register_node("scifi_nodes:tallscreen", {
  1155.     description = "tallscreen",
  1156.     tiles = {
  1157.         "scifi_nodes_black.png",
  1158.         "scifi_nodes_black.png",
  1159.         "scifi_nodes_black.png",
  1160.         "scifi_nodes_black.png",
  1161.         "scifi_nodes_black.png",
  1162.         "scifi_nodes_tallscreen.png"
  1163.     },
  1164.     drawtype = "nodebox",
  1165.     light_source = 5,
  1166.     paramtype = "light",
  1167.     paramtype2 = "facedir",
  1168.     sunlight_propagates = true,
  1169.     node_box = {
  1170.         type = "fixed",
  1171.         fixed = {
  1172.             {-0.3125, -0.375, 0.4375, 0.3125, 0.375, 0.5}, -- NodeBox1
  1173.             {-0.375, 0.375, 0.375, 0.375, 0.5, 0.5}, -- NodeBox2
  1174.             {-0.375, -0.5, 0.375, 0.375, -0.375, 0.5}, -- NodeBox3
  1175.             {0.25, -0.3125, 0.375, 0.375, 0.3125, 0.5}, -- NodeBox4
  1176.             {-0.375, -0.25, 0.375, -0.25, 0.3125, 0.5}, -- NodeBox5
  1177.             {-0.3125, -0.5, 0.375, -0.25, 0.5, 0.5}, -- NodeBox6
  1178.             {0.25, -0.5, 0.375, 0.3125, 0.5, 0.5}, -- NodeBox7
  1179.         }
  1180.     },
  1181.     groups = {cracky=1, oddly_breakable_by_hand=1}
  1182. })
  1183.  
  1184. -- https://forum.minetest.net/viewtopic.php?f=10&t=13125&p=261481#p261481
  1185. minetest.register_node("scifi_nodes:windowpanel", {
  1186.     description = "strong window panel",
  1187.     tiles = {
  1188.         "scifi_nodes_glass.png",
  1189.     },
  1190.     drawtype = "nodebox",
  1191.     paramtype = "light",
  1192.     use_texture_alpha = true,
  1193.     sunlight_propagates = true,
  1194.     paramtype2 = "facedir",
  1195.     node_box = {
  1196.         type = "fixed",
  1197.         fixed = {
  1198.             {-0.0625, -0.5, -0.5, 0.0625, 0.5, 0.5}, -- NodeBox11
  1199.         }
  1200.     },
  1201.     groups = {cracky=1},
  1202.     on_place = minetest.rotate_node,
  1203.     sounds = default.node_sound_glass_defaults(),
  1204. })
  1205.  
  1206. -- switches
  1207. local mesecons_switch_on_def = {}
  1208. local mesecons_switch_off_def = {}
  1209. local mesecons_switch_rules = {}
  1210. if  (mesecon ~= nil) and
  1211.     (mesecon.receptor_on ~= nil) and
  1212.     (mesecon.receptor_off ~= nil)           then
  1213.     mesecons_switch_on_def = {receptor = {state = mesecon.state.on, rules = mesecons_switch_rules}}
  1214.     mesecons_switch_off_def = {receptor = {state = mesecon.state.off, rules = mesecons_switch_rules}}
  1215.     minetest.register_node("scifi_nodes:switch_off", {
  1216.         description = "Wall switch",
  1217.         tiles = {
  1218.             "scifi_nodes_switch_off.png",
  1219.         },
  1220.         inventory_image = "scifi_nodes_switch_on.png",
  1221.         wield_image = "scifi_nodes_switch_on.png",
  1222.         drawtype = "signlike",
  1223.         sunlight_propagates = true,
  1224.         node_box = {
  1225.             type = "wallmounted",
  1226.         },
  1227.         selection_box = {
  1228.             type = "wallmounted",
  1229.         },
  1230.         paramtype = "light",
  1231.         paramtype2 = "wallmounted",
  1232.         groups = {cracky=1, oddly_breakable_by_hand=1, mesecon_needs_receiver = 1},
  1233.         on_rightclick = function(pos, node, clicker, item, _)
  1234.                 minetest.set_node(pos, {name="scifi_nodes:switch_on", param2=node.param2})
  1235.                 mesecon.receptor_on(pos, rules)
  1236.                 minetest.sound_play("scifi_nodes_switch", {max_hear_distance = 8, pos = pos, gain = 1.0})
  1237.         end,
  1238.         sounds = default.node_sound_glass_defaults(),
  1239.         mesecons = {receptor = { state = mesecon.state.off }}
  1240.     })
  1241.  
  1242.     minetest.register_node("scifi_nodes:switch_on", {
  1243.         description = "Wall switch",
  1244.         sunlight_propagates = true,
  1245.         tiles = {
  1246.             "scifi_nodes_switch_on.png",
  1247.         },
  1248.         inventory_image = "scifi_nodes_switch_on.png",
  1249.         wield_image = "scifi_nodes_switch_on.png",
  1250.         drawtype = "signlike",
  1251.         node_box = {
  1252.             type = "wallmounted",
  1253.         },
  1254.         selection_box = {
  1255.             type = "wallmounted",
  1256.         },
  1257.         paramtype = "light",
  1258.         paramtype2 = "wallmounted",
  1259.         light_source = 5,
  1260.         groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1, mesecon_needs_receiver = 1},
  1261.         on_rightclick = function(pos, node, clicker, item, _)
  1262.             minetest.set_node(pos, {name="scifi_nodes:switch_off", param2=node.param2})
  1263.             mesecon.receptor_off(pos, rules)
  1264.             minetest.sound_play("scifi_nodes_switch", {max_hear_distance = 8, pos = pos, gain = 1.0})
  1265.         end,
  1266.         sounds = default.node_sound_glass_defaults(),
  1267.         mesecons = {receptor = { state = mesecon.state.on }}
  1268.     })
  1269.  
  1270.     minetest.register_craft({
  1271.         output = "scifi_nodes:switch_off 2",
  1272.         recipe = {
  1273.             {"mesecons_button:button_off", "scifi_nodes:grey", ""}
  1274.         }
  1275.     })
  1276.    
  1277. else
  1278.     --wall switch, currently does not do anything
  1279.     minetest.register_node("scifi_nodes:switch_off", {
  1280.         description = "Wall switch",
  1281.         tiles = {
  1282.             "scifi_nodes_switch_off.png",
  1283.         },
  1284.         inventory_image = "scifi_nodes_switch_on.png",
  1285.         wield_image = "scifi_nodes_switch_on.png",
  1286.         drawtype = "signlike",
  1287.         sunlight_propagates = true,
  1288.         node_box = {
  1289.             type = "wallmounted",
  1290.         },
  1291.         selection_box = {
  1292.             type = "wallmounted",
  1293.         },
  1294.         paramtype = "light",
  1295.         paramtype2 = "wallmounted",
  1296.         groups = {cracky=1, oddly_breakable_by_hand=1},
  1297.         on_rightclick = function(pos, node, clicker, item, _)
  1298.                 minetest.set_node(pos, {name="scifi_nodes:switch_on", param2=node.param2})
  1299.                 minetest.sound_play("scifi_nodes_switch", {max_hear_distance = 8, pos = pos, gain = 1.0})
  1300.         end,
  1301.         sounds = default.node_sound_glass_defaults()
  1302.     })
  1303.  
  1304.     minetest.register_node("scifi_nodes:switch_on", {
  1305.         description = "Wall switch",
  1306.         sunlight_propagates = true,
  1307.         tiles = {
  1308.             "scifi_nodes_switch_on.png",
  1309.         },
  1310.         inventory_image = "scifi_nodes_switch_on.png",
  1311.         wield_image = "scifi_nodes_switch_on.png",
  1312.         drawtype = "signlike",
  1313.         node_box = {
  1314.             type = "wallmounted",
  1315.         },
  1316.         selecion_box = {
  1317.             type = "wallmounted",
  1318.         },
  1319.         paramtype = "light",
  1320.         paramtype2 = "wallmounted",
  1321.         light_source = 5,
  1322.         groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  1323.         on_rightclick = function(pos, node, clicker, item, _)
  1324.                 minetest.set_node(pos, {name="scifi_nodes:switch_off", param2=node.param2})
  1325.                 minetest.sound_play("scifi_nodes_switch", {max_hear_distance = 8, pos = pos, gain = 1.0})
  1326.         end,
  1327.         sounds = default.node_sound_glass_defaults()
  1328.     })     --end of wall switch
  1329. end -- if(mesecon.receptor ~= on
  1330.  
  1331. -- Digicode
  1332. local function toggle_digicode(pos,node)
  1333.     local name = node.name
  1334.     if name == "scifi_nodes:digicode_off" then
  1335.         minetest.sound_play("scifi_nodes_digicode", {max_hear_distance = 8, pos = pos, gain = 1.0})
  1336.         minetest.set_node(pos, {name="scifi_nodes:digicode_on", param2=node.param2})
  1337.         mesecon.receptor_on(pos, rules)
  1338.         minetest.get_node_timer(pos):start(1)
  1339.     else
  1340.         minetest.set_node(pos, {name="scifi_nodes:digicode_off", param2=node.param2})
  1341.         mesecon.receptor_off(pos, rules)
  1342.     end
  1343. end
  1344.  
  1345. local function digicode_turn_off (pos)
  1346.     local node = minetest.get_node(pos)
  1347.     minetest.set_node (pos, {name = "scifi_nodes:digicode_off", param2 = node.param2})
  1348.     mesecon.receptor_off(pos, rules)
  1349.     return false
  1350. end
  1351.  
  1352. local digicode_rules = {
  1353.     {x=1, y=-1, z=1},
  1354.     {x=1, y=-1, z=-1},
  1355.     {x=-1, y=-1, z=1},
  1356.     {x=-1, y=-1, z=-1}
  1357. }
  1358.  
  1359. if (mesecon ~= nil) and
  1360.     (mesecon.receptor_on ~= nil) and
  1361.     (mesecon.receptor_off ~= nil) then
  1362.     minetest.register_node("scifi_nodes:digicode_off", {
  1363.         description = "Digicode",
  1364.         tiles = {
  1365.             "scifi_nodes_digicode_off.png",
  1366.         },
  1367.         inventory_image = "scifi_nodes_digicode_on.png",
  1368.         wield_image = "scifi_nodes_digicode_on.png",
  1369.         drawtype = "signlike",
  1370.         sunlight_propagates = true,
  1371.         node_box = {
  1372.             type = "wallmounted",
  1373.             },
  1374.         selection_box = {
  1375.             type = "wallmounted",
  1376.         },
  1377.         paramtype = "light",
  1378.         paramtype2 = "wallmounted",
  1379.         groups = {cracky=1, oddly_breakable_by_hand=1, mesecon_needs_receiver = 1},
  1380.         on_rightclick = toggle_digicode,
  1381.         sounds = default.node_sound_glass_defaults(),
  1382.         mesecons = {receptor = { state = mesecon.state.on }}
  1383.     })
  1384.  
  1385.     minetest.register_node("scifi_nodes:digicode_on", {
  1386.         description = "Wall switch",
  1387.         sunlight_propagates = true,
  1388.         tiles = {
  1389.             "scifi_nodes_digicode_on.png",
  1390.         },
  1391.         inventory_image = "scifi_nodes_digicode_on.png",
  1392.         wield_image = "scifi_nodes_digicode_on.png",
  1393.         drawtype = "signlike",
  1394.         node_box = {
  1395.             type = "wallmounted",
  1396.         },
  1397.         selection_box = {
  1398.             type = "wallmounted",
  1399.         },
  1400.         paramtype = "light",
  1401.         paramtype2 = "wallmounted",
  1402.         light_source = 5,
  1403.         groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1, mesecon_needs_receiver = 1},
  1404.         on_rightclick = toggle_digicode,
  1405.         on_timer = digicode_turn_off,
  1406.         sounds = default.node_sound_glass_defaults(),
  1407.         mesecons = {receptor = { state = mesecon.state.on, rules = digicode_rules }}
  1408.     })
  1409.  
  1410.     minetest.register_craft({
  1411.         output = "scifi_nodes:digicode_off 2",
  1412.         recipe = {
  1413.             {"mesecons_switch:mesecon_switch_off", "scifi_nodes:grey", ""}
  1414.         }
  1415.     })
  1416.  
  1417. -- In case mesecons mod is missing :
  1418. else
  1419.     minetest.register_node("scifi_nodes:digicode_off", {
  1420.         description = "Digicode",
  1421.         tiles = {
  1422.             "scifi_nodes_digicode_off.png",
  1423.         },
  1424.         inventory_image = "scifi_nodes_digicode_on.png",
  1425.         wield_image = "scifi_nodes_digicode_on.png",
  1426.         drawtype = "signlike",
  1427.         sunlight_propagates = true,
  1428.         node_box = {
  1429.             type = "wallmounted",
  1430.         },
  1431.         selection_box = {
  1432.             type = "wallmounted",
  1433.         },
  1434.         paramtype = "light",
  1435.         paramtype2 = "wallmounted",
  1436.         groups = {cracky=1, oddly_breakable_by_hand=1},
  1437.         on_rightclick = function(pos, node, clicker, item, _)
  1438.                 minetest.sound_play("scifi_nodes_digicode", {max_hear_distance = 8, pos = pos, gain = 1.0})
  1439.                 minetest.swap_node(pos, {name="scifi_nodes:digicode_on", param2=node.param2})
  1440.         end,
  1441.         sounds = default.node_sound_glass_defaults()
  1442.     })
  1443.  
  1444.     minetest.register_node("scifi_nodes:digicode_on", {
  1445.         description = "Digicode",
  1446.         sunlight_propagates = true,
  1447.         tiles = {
  1448.             "scifi_nodes_switch_on.png",
  1449.         },
  1450.         inventory_image = "scifi_nodes_digicode_on.png",
  1451.         wield_image = "scifi_nodes_digicode_on.png",
  1452.         drawtype = "signlike",
  1453.         node_box = {
  1454.             type = "wallmounted",
  1455.         },
  1456.         selecion_box = {
  1457.             type = "wallmounted",
  1458.         },
  1459.         paramtype = "light",
  1460.         paramtype2 = "wallmounted",
  1461.         light_source = 5,
  1462.         groups = {cracky=1, oddly_breakable_by_hand=1, not_in_creative_inventory=1},
  1463.         on_rightclick = function(pos, node, clicker, item, _)
  1464.             minetest.swap_node(pos, {name="scifi_nodes:digicode_off", param2=node.param2})
  1465.         end,
  1466.         on_timer = function(pos, node, clicker, item, _)
  1467.             minetest.swap_node(pos, {name="scifi_nodes:digicode_off", param2=node.param2})
  1468.         end,
  1469.         sounds = default.node_sound_glass_defaults()
  1470.     })    
  1471. end -- if(mesecon.receptor ~= on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement