i have noticed that tree trunks rotate automatic to horizontal position when they are placed on the side of another node. very handy.
but this only affects the default, jungle and pine tree trunks. all 3 are in the default game, so i guess it is coded into the node definition.
wooden planks are all included in the group "wood" so that crafting recipes that use wood can use every kind of wood planks from any mod.
i was wondering if it was possible to make a group "trunk" that includes all tree trunks, so that every trunk from every mod would auto rotate itself when placed.
auto-rotating tree trunks
auto-rotating tree trunks
✨🏳️🌈♣️✨
Re: auto-rotating tree trunks
Here is the node definition for the default tree trunk:
so long as the on_place = minetest.rotate_node is in place with the paramtype2 = "facedir", then no-matter what node or tree type it is, it will automatically rotate when placed...
Code: Select all
minetest.register_node("default:tree", {
description = "Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
Who is online
Users browsing this forum: No registered users and 7 guests