mirror of
https://github.com/joe7575/techpack.git
synced 2025-04-02 00:13:01 +02: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:
@ -35,6 +35,15 @@ local Tube = tubelib2.Tube:new({
|
|||||||
|
|
||||||
tubelib.Tube = Tube
|
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", {
|
minetest.register_node("tubelib:tubeS", {
|
||||||
description = S("Tubelib Tube"),
|
description = S("Tubelib Tube"),
|
||||||
tiles = { -- Top, base, right, left, front, back
|
tiles = { -- Top, base, right, left, front, back
|
||||||
@ -80,6 +89,7 @@ minetest.register_node("tubelib:tubeS", {
|
|||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = {choppy=2, cracky=3},
|
groups = {choppy=2, cracky=3},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
on_blast = ON_BLAST("tubelib:tubeS"),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("tubelib:tubeA", {
|
minetest.register_node("tubelib:tubeA", {
|
||||||
@ -121,6 +131,7 @@ minetest.register_node("tubelib:tubeA", {
|
|||||||
groups = {choppy=2, cracky=3, not_in_creative_inventory=1},
|
groups = {choppy=2, cracky=3, not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
drop = "tubelib:tubeS",
|
drop = "tubelib:tubeS",
|
||||||
|
on_blast = ON_BLAST("tubelib:tubeA"),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
Reference in New Issue
Block a user