electric/mods/ebiometrees/sapling.lua
Aleksey Chubukov 0eafd454e2 day 2023-03-05: tree sprout, fixes
* fixed .luacheckrc
* added growing trunk
* added sprout timer function
* removed and ignored Krita backup files
2023-03-15 22:53:30 +03:00

29 lines
767 B
Lua

ebiometrees = {}
function ebiometrees.get_sapling_grower(sprout_name)
local function rooter(pos)
minetest.set_node(pos, {name=sprout_name})
end
return rooter
end
function ebiometrees.get_sprout_grower(trunk_name, apex_name)
local function grower(pos)
minetest.set_node(pos, {name=trunk_name})
local upper = {x=pos.x, y=pos.y+1, z=pos.z}
minetest.set_node(upper, {name=apex_name})
end
return grower
end
function ebiometrees.root_sapling(pos)
minetest.set_node(pos, {name="ebiome:oak_sprout"})
return false
end
function ebiometrees.set_rooting_sapling(itemstack, placer, pointed_thing)
itemstack = minetest.item_place(itemstack, placer, pointed_thing)
minetest.get_node_timer(pointed_thing.above):start(3)
return itemstack
end