electric/mods/ebiometrees/api.lua

17 lines
612 B
Lua
Raw Normal View History

2023-05-10 23:39:08 +00:00
ebiometrees.registered_trees = {}
function ebiometrees.register_tree(name, data)
ebiometrees.registered_trees[name] = data
ebiometrees.register_subnodes(name)
end
function ebiometrees.register_subnodes(tree_name)
local modname = tree_name:match("([^:]*):")
local basename = tree_name:match(":([^:]+)")
local data = ebiometrees.registered_trees[tree_name]
ebiometrees.register_tree_sapling(modname, basename, data)
ebiometrees.register_tree_sprout(modname, basename, data)
ebiometrees.register_tree_leaves(modname, basename, data)
ebiometrees.register_tree_trunks(modname, basename, data)
end