summaryrefslogtreecommitdiff
path: root/pipeworks/autoplace_tubes.lua
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-09-21 03:05:26 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2018-09-21 03:05:26 -0400
commit4f86bcc7aac8b536eef38b3f885821a68a4cca18 (patch)
tree748205526a92edba2fac0d3c65fdfd2e7a63100d /pipeworks/autoplace_tubes.lua
parentaf02750c7ab30c48482575461b06d7ef37c359a7 (diff)
downloaddreambuilder_modpack-4f86bcc7aac8b536eef38b3f885821a68a4cca18.tar
dreambuilder_modpack-4f86bcc7aac8b536eef38b3f885821a68a4cca18.tar.gz
dreambuilder_modpack-4f86bcc7aac8b536eef38b3f885821a68a4cca18.tar.bz2
dreambuilder_modpack-4f86bcc7aac8b536eef38b3f885821a68a4cca18.tar.xz
dreambuilder_modpack-4f86bcc7aac8b536eef38b3f885821a68a4cca18.zip
added some new mods:
* digidisplay by cheapie (re-implementation of "textline", displays text in multiple sizes, not entirely unlike LCD's, but bigger text) * simple_steetlights by me (makes building street lights nearly effortless) * street_signs (common street name sign, i.e. the 2-up green ones on most street corners, forked from signs_lib) also updated mesecons and pipeworks
Diffstat (limited to 'pipeworks/autoplace_tubes.lua')
-rw-r--r--pipeworks/autoplace_tubes.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/pipeworks/autoplace_tubes.lua b/pipeworks/autoplace_tubes.lua
index 0d28e64..a3a6aee 100644
--- a/pipeworks/autoplace_tubes.lua
+++ b/pipeworks/autoplace_tubes.lua
@@ -111,6 +111,22 @@ function pipeworks.after_dig(pos)
pipeworks.scan_for_tube_objects(pos)
end
+-- Screwdriver calls this function before rotating a node.
+-- However, connections must be updated *after* the node is rotated
+-- So, this function does the rotation itself and returns `true`.
+-- (Note: screwdriver already checks for protected areas.)
+
+-- This should only be used for tubes that don't autoconnect.
+-- (For example, one-way tubes.)
+-- Autoconnecting tubes will just revert back to their original state
+-- when they are updated.
+function pipeworks.on_rotate(pos, node, user, mode, new_param2)
+ node.param2 = new_param2
+ minetest.set_node(pos, node)
+ pipeworks.scan_for_tube_objects(pos)
+ return true
+end
+
if minetest.get_modpath("mesecons_mvps") then
mesecon.register_on_mvps_move(function(moved_nodes)
for _, n in ipairs(moved_nodes) do