Mossmanikin wrote:How do I overwrite a node like trees:tree_conifer from Tiny Trees?
I want to do this in my mod Alternative Trunks.
Here's an example of something I tried:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local cube = {-0.5 , -0.5 , -0.5 , 0.5 , 0.5 , 0.5 }
local cylinder = {
{-0.1875, -0.5 , -0.5 , 0.1875, 0.5 , 0.5 },
{-0.5 , -0.5 , -0.1875, 0.5 , 0.5 , 0.1875},
{-0.3125, -0.5 , -0.4375, 0.3125, 0.5 , 0.4375},
{-0.4375, -0.5 , -0.3125, 0.4375, 0.5 , 0.3125},
{-0.375 , -0.5 , -0.375 , 0.375 , 0.5 , 0.375 },
}
if minetest.get_modpath("trees") ~= nil then
minetest.register_node(":trees:tree_conifer", {
description = "Conifer trunk",
paramtype = "light",
tiles = {
"trees_tree_top_conifer.png",
"trees_tree_top_conifer.png",
"trees_tree_conifer.png"},
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = cube,
},
node_box = {
type = "fixed",
fixed = cylinder,
},
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
end
This doesn't work.
What did I do wrong?
Your code has nothing wrong. What I assume here is that the 'trees' mod is loaded after 'alttrunks', thus overwriting your definition.
You could fix that by putting 'trees' in optdepends.txt, or 'trees?' in depends.txt (requires git version of server though).
Edit: typo
