electric/mods/ebiometrees/api.lua
Alexey Chubukov b3a3ec421f wip
2023-12-14 15:05:44 +04:00

23 lines
725 B
Lua

ebiometrees.registered_trees = {}
function ebiometrees.register_tree(name, treespec)
ebiometrees.registered_trees[name] = treespec
ebiometrees.register_subnodes(name)
end
function ebiometrees.register_subnodes(tree_name)
local modname = tree_name:match("([^:]*):")
local basename = tree_name:match(":([^:]+)")
local treespec = ebiometrees.registered_trees[tree_name]
ebiometrees.register_tree_sapling(modname, basename, treespec)
ebiometrees.register_tree_sprout(modname, basename, treespec)
ebiometrees.register_tree_leaves(modname, basename, treespec)
ebiometrees.register_tree_trunks(modname, basename, treespec)
end
function ebiometrees.get_tree_leaves(tree_name)
return tree_name.."_leaves"
end