summaryrefslogtreecommitdiff
path: root/pipeworks/tube_registration.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-09 01:27:28 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-04-09 01:27:28 -0400
commit7acbe4fcf319bffc29812d4c5f3718c5f23886ff (patch)
treea57cc76d1c820f47e2d120c20c342d01308761db /pipeworks/tube_registration.lua
parent72ff7606f50d827849aebad589f16cdc51ad872a (diff)
downloaddreambuilder_modpack-7acbe4fcf319bffc29812d4c5f3718c5f23886ff.tar
dreambuilder_modpack-7acbe4fcf319bffc29812d4c5f3718c5f23886ff.tar.gz
dreambuilder_modpack-7acbe4fcf319bffc29812d4c5f3718c5f23886ff.tar.bz2
dreambuilder_modpack-7acbe4fcf319bffc29812d4c5f3718c5f23886ff.tar.xz
dreambuilder_modpack-7acbe4fcf319bffc29812d4c5f3718c5f23886ff.zip
update pipeworks
Diffstat (limited to 'pipeworks/tube_registration.lua')
-rw-r--r--pipeworks/tube_registration.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/pipeworks/tube_registration.lua b/pipeworks/tube_registration.lua
index c720755..21eac29 100644
--- a/pipeworks/tube_registration.lua
+++ b/pipeworks/tube_registration.lua
@@ -38,11 +38,11 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
local outboxes = {}
local outsel = {}
local outimgs = {}
-
+
for i = 1, 6 do
outimgs[vti[i]] = plain[i]
end
-
+
for _, v in ipairs(connects) do
pipeworks.table_extend(outboxes, pipeworks.tube_boxes[v])
table.insert(outsel, pipeworks.tube_selectboxes[v])
@@ -73,10 +73,10 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
outsel = { -24/64, -10/64, -10/64, 24/64, 10/64, 10/64 }
wscale = {x = 1, y = 1, z = 0.01}
end
-
+
local rname = string.format("%s_%s", name, tname)
table.insert(tubenodes, rname)
-
+
local nodedef = {
description = tubedesc,
drawtype = "nodebox",
@@ -107,12 +107,20 @@ local register_one_tube = function(name, tname, dropname, desc, plain, noctrs, e
priority = 50
},
after_place_node = pipeworks.after_place,
- after_dig_node = pipeworks.after_dig
+ after_dig_node = pipeworks.after_dig,
+ on_blast = function(pos, intensity)
+ if intensity > 1 + 3^0.5 then
+ minetest.remove_node(pos)
+ return {string.format("%s_%s", name, dropname)}
+ end
+ minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})
+ pipeworks.scan_for_tube_objects(pos)
+ end
}
if style == "6d" then
nodedef.paramtype2 = "facedir"
end
-
+
if special == nil then special = {} end
for key, value in pairs(special) do