summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2012-08-21 14:32:44 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2012-08-21 14:32:44 -0400
commit50522aeae9d76adc6676554a9a732610edb0ade9 (patch)
tree0ec2cdb1f92d2a2639e489461d86fdbcf36d50f3 /init.lua
parent564abfe45a856f75d7b711decaebb22cdf062118 (diff)
downloadpipeworks-50522aeae9d76adc6676554a9a732610edb0ade9.tar
pipeworks-50522aeae9d76adc6676554a9a732610edb0ade9.tar.gz
pipeworks-50522aeae9d76adc6676554a9a732610edb0ade9.tar.bz2
pipeworks-50522aeae9d76adc6676554a9a732610edb0ade9.tar.xz
pipeworks-50522aeae9d76adc6676554a9a732610edb0ade9.zip
reorganized code a bit to allow for upcoming rules changes.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua30
1 files changed, 4 insertions, 26 deletions
diff --git a/init.lua b/init.lua
index db18d8d..bfab761 100644
--- a/init.lua
+++ b/init.lua
@@ -270,21 +270,10 @@ for zp = 0, 1 do
meta:set_int("pipelike",1)
end,
after_place_node = function(pos)
- pipe_autoroute({ x=pos.x-1, y=pos.y , z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x+1, y=pos.y , z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y-1, z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y+1, z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z-1 }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z+1 }, "_empty")
- pipe_autoroute(pos, "_empty")
+ pipe_scanforobjects(pos)
end,
after_dig_node = function(pos)
- pipe_autoroute({ x=pos.x-1, y=pos.y , z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x+1, y=pos.y , z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y-1, z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y+1, z=pos.z }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z-1 }, "_empty")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z+1 }, "_empty")
+ pipe_scanforobjects(pos)
end
})
@@ -312,21 +301,10 @@ for zp = 0, 1 do
meta:set_int("pipelike",1)
end,
after_place_node = function(pos)
- pipe_autoroute({ x=pos.x-1, y=pos.y , z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x+1, y=pos.y , z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y-1, z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y+1, z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z-1 }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z+1 }, "_loaded")
- pipe_autoroute(pos, "_loaded")
+ pipe_scanforobjects(pos)
end,
after_dig_node = function(pos)
- pipe_autoroute({ x=pos.x-1, y=pos.y , z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x+1, y=pos.y , z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y-1, z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y+1, z=pos.z }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z-1 }, "_loaded")
- pipe_autoroute({ x=pos.x , y=pos.y , z=pos.z+1 }, "_loaded")
+ pipe_scanforobjects(pos)
end
})
end