make youngtrees, bushes fall on dig,

make moss fall when the node holding it is dug,
and make trunk roots decay (exploiting the standard leafdecay function)
This commit is contained in:
Vanessa Dannenberg 2021-06-19 20:34:22 -04:00
parent c061ef23cf
commit 7b4f54ead0
3 changed files with 18 additions and 10 deletions

View File

@ -26,7 +26,7 @@ node_box = {
{-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1 {-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1
} }
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick' drop = 'default:stick'
}) })
@ -61,7 +61,8 @@ for i in pairs(BushBranchCenter) do
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
flammable=2, flammable=2,
leaves=1 leaves=1,
attached_node=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick 4' drop = 'default:stick 4'
@ -104,7 +105,8 @@ for i in pairs(BushBranchSide) do
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
flammable=2, flammable=2,
leaves=1 leaves=1,
attached_node=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick 3' drop = 'default:stick 3'

View File

@ -79,7 +79,7 @@ minetest.register_node("trunks:moss", {
walkable = false, walkable = false,
node_box = {type = "fixed", fixed = flat_moss}, node_box = {type = "fixed", fixed = flat_moss},
selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"}, selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"},
groups = {snappy = 3, flammable = 3 }, groups = {snappy = 3, flammable = 3, attached_node=1 },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
}) })
@ -98,7 +98,7 @@ minetest.register_node("trunks:moss_fungus", {
walkable = false, walkable = false,
node_box = {type = "fixed", fixed = flat_moss}, node_box = {type = "fixed", fixed = flat_moss},
selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"}, selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"},
groups = {snappy = 3, flammable = 3 }, groups = {snappy = 3, flammable = 3, attached_node=1 },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
}) })
@ -361,13 +361,19 @@ for i in pairs(TRuNKS) do
snappy=1, snappy=1,
choppy=2, choppy=2,
oddly_breakable_by_hand=1, oddly_breakable_by_hand=1,
flammable=2--, flammable=2,
--not_in_creative_inventory=1 -- atm in inv for testing --not_in_creative_inventory=1 -- atm in inv for testing
}, },
--drop = "trunks:twig_1", -- not sure about this yet --drop = "trunks:twig_1", -- not sure about this yet
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
default.register_leafdecay({
trunks = { MoD..":"..TRuNK },
leaves = { "trunks:"..TRuNK.."root" },
radius = 1,
})
else else
minetest.log("error", string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK)) minetest.log("error", string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK))
end end

View File

@ -40,7 +40,7 @@ minetest.register_node("youngtrees:youngtree2_middle",{
{-0.500000,0.125000,-0.500000,0.500000,0.500000,0.500000}, --NodeBox 3 {-0.500000,0.125000,-0.500000,0.500000,0.500000,0.500000}, --NodeBox 3
} }
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
@ -58,7 +58,7 @@ minetest.register_node("youngtrees:youngtree_top", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
@ -77,7 +77,7 @@ minetest.register_node("youngtrees:youngtree_middle", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
@ -97,7 +97,7 @@ minetest.register_node("youngtrees:youngtree_bottom", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })