Skip to content

Commit b0496fc

Browse files
fix issue #150 (prevent non-tubes / reinforced tubes from breaking) (#153)
* fix #150 (issue #150) * tube not tube device * tntd * embedded tube is durable * Update pane_embedded_tube.lua * Update registration.lua * Update item_transport.lua * redundant * one-way tube is tube * pipe not tube * built-in method * more deduplication * "=" → " = "
1 parent 858154c commit b0496fc

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

item_transport.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ end)
8484

8585
function pipeworks.break_tube(pos)
8686
local node = minetest.get_node(pos)
87+
if core.get_item_group(node.name, "tube") ~= 1 then return end
8788
local meta = minetest.get_meta(pos)
8889
meta:set_string("the_tube_was", minetest.serialize(node))
8990
minetest.swap_node(pos, {name = "pipeworks:broken_tube_1"})

pipes.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ for index, connects in ipairs(cconnects) do
3737
end
3838
--]]
3939

40-
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4, axey=1, handy=1, pickaxey=1}
40+
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4, axey = 1, handy = 1, pickaxey = 1}
4141
local pipedesc = S("Pipe Segment").." "..dump(connects)
4242

4343
if #connects == 0 then
44-
pgroups = {snappy = 3, tube = 1, dig_generic = 4, axey=1, handy=1, pickaxey=1}
44+
pgroups = {snappy = 3, pipe = 1, dig_generic = 4, axey = 1, handy = 1, pickaxey = 1}
4545
pipedesc = S("Pipe Segment")
4646
end
4747

@@ -77,7 +77,7 @@ for index, connects in ipairs(cconnects) do
7777
},
7878
groups = pgroups,
7979
is_ground_content = false,
80-
_mcl_hardness=0.8,
80+
_mcl_hardness = 0.8,
8181
_sound_def = {
8282
key = "node_sound_metal_defaults",
8383
},
@@ -95,7 +95,7 @@ for index, connects in ipairs(cconnects) do
9595
pipenumber = index
9696
})
9797

98-
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4, axey=1, handy=1, pickaxey=1}
98+
local pgroups = {snappy = 3, pipe = 1, not_in_creative_inventory = 1, dig_generic = 4, axey = 1, handy = 1, pickaxey = 1}
9999

100100
minetest.register_node("pipeworks:pipe_"..index.."_loaded", {
101101
description = pipedesc,
@@ -115,7 +115,7 @@ for index, connects in ipairs(cconnects) do
115115
},
116116
groups = pgroups,
117117
is_ground_content = false,
118-
_mcl_hardness=0.8,
118+
_mcl_hardness = 0.8,
119119
_sound_def = {
120120
key = "node_sound_metal_defaults",
121121
},

tubes/pane_embedded_tube.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ minetest.register_node("pipeworks:steel_pane_embedded_tube", {
3030
collision_box = pane_box,
3131
paramtype = "light",
3232
paramtype2 = "facedir",
33-
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, dig_glass = 2, pickaxey=1, handy=1},
33+
groups = {cracky=1, oddly_breakable_by_hand = 1, tubedevice = 1, tube = 1, dig_glass = 2, pickaxey=1, handy=1},
3434
is_ground_content = false,
3535
_mcl_hardness=0.8,
3636
legacy_facedir_simple = true,

tubes/routing.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ if pipeworks.enable_one_way_tube then
179179
paramtype = "light",
180180
node_box = {type = "fixed",
181181
fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}},
182-
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, axey=1, handy=1, pickaxey=1},
182+
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, tube = 1, axey=1, handy=1, pickaxey=1},
183183
is_ground_content = false,
184184
_mcl_hardness=0.8,
185185
_sound_def = {

0 commit comments

Comments
 (0)