mirror of
https://github.com/joe7575/techpack.git
synced 2025-01-12 15:57:33 +01:00
Merge pull request #58 from oversword/bls-254
Add a on_blast callback to tubes so they update after being destroyed
This commit is contained in:
commit
ce82cf68bc
@ -35,6 +35,15 @@ local Tube = tubelib2.Tube:new({
|
||||
|
||||
tubelib.Tube = Tube
|
||||
|
||||
local function ON_BLAST(id)
|
||||
return function (pos)
|
||||
local node = minetest.get_node(pos)
|
||||
minetest.remove_node(pos)
|
||||
Tube:after_dig_tube(pos, node)
|
||||
return {id}
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("tubelib:tubeS", {
|
||||
description = S("Tubelib Tube"),
|
||||
tiles = { -- Top, base, right, left, front, back
|
||||
@ -80,6 +89,7 @@ minetest.register_node("tubelib:tubeS", {
|
||||
is_ground_content = false,
|
||||
groups = {choppy=2, cracky=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_blast = ON_BLAST("tubelib:tubeS"),
|
||||
})
|
||||
|
||||
minetest.register_node("tubelib:tubeA", {
|
||||
@ -121,6 +131,7 @@ minetest.register_node("tubelib:tubeA", {
|
||||
groups = {choppy=2, cracky=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
drop = "tubelib:tubeS",
|
||||
on_blast = ON_BLAST("tubelib:tubeA"),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
Loading…
Reference in New Issue
Block a user