Jordan Snelling
2013-06-27 c687e8cb7b9e624474353b0cc10acc5db14192f8
technic/frames.lua
@@ -1,3 +1,5 @@
frames={}
function get_face(pos,ppos,pvect)
   ppos={x=ppos.x-pos.x,y=ppos.y-pos.y+1.5,z=ppos.z-pos.z}
   if pvect.x>0 then
@@ -96,6 +98,10 @@
      node_box = {
         type = "fixed",
      fixed=nodeboxes,
      },
      selection_box = {
         type="fixed",
         fixed={-0.5,-0.5,-0.5,0.5,0.5,0.5}
      },
      paramtype = "light",
      frame=1,
@@ -356,8 +362,10 @@
function move_nodes_vect(poslist,vect)
      for _,pos in ipairs(poslist) do
      local npos=addVect(pos,vect)
      if minetest.env:get_node(npos).name~="air" and not(pos_in_list(poslist,npos)) then return end
      local npos=frames.addVect(pos,vect)
      local name = minetest.env:get_node(npos).name
      if (name~="air" and minetest.registered_nodes[name].liquidtype=="none") and not(pos_in_list(poslist,npos)) then
 return end
   end
   nodelist={}
   for _,pos in ipairs(poslist) do
@@ -372,14 +380,14 @@
      end
   end
   for _,obj in ipairs(objects) do
      obj:setpos(addVect(obj:getpos(),vect))
      if obj:get_luaentity().name == "pipeworks:tubed_item" then
         le=obj:get_luaentity()
         le.start_pos=addVect(le.start_pos,vect)
      obj:setpos(frames.addVect(obj:getpos(),vect))
      le=obj:get_luaentity()
      if le and le.name == "pipeworks:tubed_item" then
         le.start_pos=frames.addVect(le.start_pos,vect)
      end
   end
   for _,n in ipairs(nodelist) do
      local npos=addVect(n.pos,vect)
      local npos=frames.addVect(n.pos,vect)
      minetest.env:set_node(npos,n.node)
      local meta=minetest.env:get_meta(npos)
      meta:from_table(n.meta)
@@ -402,7 +410,7 @@
   return c
end
function addVect(pos,vect)
function frames.addVect(pos,vect)
   return {x=pos.x+vect.x,y=pos.y+vect.y,z=pos.z+vect.z}
end
@@ -415,7 +423,7 @@
function connected(pos,c,adj)
   for _,vect in ipairs(adj) do
      local pos1=addVect(pos,vect)
      local pos1=frames.addVect(pos,vect)
      local nodename=minetest.env:get_node(pos1).name
      if not(pos_in_list(c,pos1)) and nodename~="air" and
      (minetest.registered_nodes[nodename].frames_can_connect==nil or