Update 'mods/ethereal/sapling.lua'

This commit is contained in:
thunderdog1138 2020-05-19 02:42:37 +00:00
parent c3f8dcdad5
commit 897ea5ba23
1 changed files with 37 additions and 68 deletions

View File

@ -28,7 +28,7 @@ minetest.register_node("ethereal:bamboo_sprout", {
local register_sapling = function(name, desc, texture, height) local register_sapling = function(name, desc, texture, height)
minetest.register_node(name .. "_sapling", { minetest.register_node(name .. "_sapling", {
description = S(desc .. " Tree Sapling"), description = S(desc .. " Sapling"),
drawtype = "plantlike", drawtype = "plantlike",
tiles = {texture .. ".png"}, tiles = {texture .. ".png"},
inventory_image = texture .. ".png", inventory_image = texture .. ".png",
@ -50,17 +50,14 @@ local register_sapling = function(name, desc, texture, height)
}) })
end end
register_sapling("ethereal:willow", "Willow", "willow_sapling", 14) register_sapling("ethereal:jogan_tree", "Jogan Tree", "jogan_tree_sapling", 6)
register_sapling("ethereal:yellow_tree", "Healing", "yellow_tree_sapling", 19) register_sapling("ethereal:uneti_tree", "Uneti Tree", "uneti_tree_sapling", 7)
register_sapling("ethereal:big_tree", "Big", "ethereal_big_tree_sapling", 7) register_sapling("ethereal:brylark_tree", "Brylark Tree", "frost_tree_sapling", 19)
register_sapling("ethereal:banana_tree", "Banana", "banana_tree_sapling", 8) register_sapling("ethereal:mushroom", "Giant Mushroom", "mushroom_sapling", 11)
register_sapling("ethereal:frost_tree", "Frost", "ethereal_frost_tree_sapling", 19) register_sapling("ethereal:palm_tree", "Palm Tree", "palm_tree_sapling", 9)
register_sapling("ethereal:mushroom", "Mushroom", "ethereal_mushroom_sapling", 11) register_sapling("ethereal:wroshyr_tree", "Wroshyr Tree", "wroshyr_tree_sapling", 31)
register_sapling("ethereal:palm", "Palm", "moretrees_palm_sapling", 9) register_sapling("ethereal:gnarltree", "Gnarltree", "gnarltree_sapling", 7)
register_sapling("ethereal:redwood", "Redwood", "redwood_sapling", 31) register_sapling("ethereal:pine_tree", "Pine_tree", "sakura_sapling", 14)
register_sapling("ethereal:orange_tree", "Orange", "orange_tree_sapling", 6)
register_sapling("ethereal:birch", "Birch", "moretrees_birch_sapling", 7)
register_sapling("ethereal:sakura", "Sakura", "ethereal_sakura_sapling", 10)
local add_tree = function (pos, ofx, ofy, ofz, schem, replace) local add_tree = function (pos, ofx, ofy, ofz, schem, replace)
-- check for schematic -- check for schematic
@ -78,57 +75,41 @@ end
local path = minetest.get_modpath("ethereal") .. "/schematics/" local path = minetest.get_modpath("ethereal") .. "/schematics/"
-- grow tree functions -- grow tree functions
function ethereal.grow_yellow_tree(pos)
add_tree(pos, 4, 0, 4, ethereal.yellowtree) function ethereal.grow_uneti_tree(pos)
add_tree(pos, 4, 0, 4, ethereal.uneti_tree)
end end
function ethereal.grow_big_tree(pos) function ethereal.grow_brylark_tree(pos)
add_tree(pos, 4, 0, 4, ethereal.bigtree) add_tree(pos, 4, 0, 4, ethereal.brylark_tree)
end
function ethereal.grow_banana_tree(pos)
add_tree(pos, 3, 0, 3, ethereal.bananatree)
end
function ethereal.grow_frost_tree(pos)
add_tree(pos, 4, 0, 4, ethereal.frosttrees)
end end
function ethereal.grow_mushroom_tree(pos) function ethereal.grow_mushroom_tree(pos)
add_tree(pos, 4, 0, 4, ethereal.mushroomone) add_tree(pos, 4, 0, 4, ethereal.mushroom)
end end
function ethereal.grow_palm_tree(pos) function ethereal.grow_palm_tree(pos)
add_tree(pos, 4, 0, 4, ethereal.palmtree) add_tree(pos, 4, 0, 4, ethereal.palm_tree)
end end
function ethereal.grow_willow_tree(pos) function ethereal.grow_wroshyr_tree(pos)
add_tree(pos, 5, 0, 5, ethereal.willow) add_tree(pos, 7, 0, 7, ethereal.wroshyr_tree)
end end
function ethereal.grow_redwood_tree(pos) function ethereal.grow_jogan_tree(pos)
add_tree(pos, 7, 0, 7, ethereal.redwood_tree) add_tree(pos, 1, 0, 1, ethereal.jogan_tree)
end
function ethereal.grow_orange_tree(pos)
add_tree(pos, 1, 0, 1, ethereal.orangetree)
end end
function ethereal.grow_bamboo_tree(pos) function ethereal.grow_bamboo_tree(pos)
add_tree(pos, 1, 0, 1, ethereal.bambootree) add_tree(pos, 1, 0, 1, ethereal.bamboo_tree)
end end
function ethereal.grow_birch_tree(pos) function ethereal.grow_pine_tree(pos)
add_tree(pos, 2, 0, 2, ethereal.birchtree) add_tree(pos, 3, 0, 3, ethereal.pine_tree)
end end
function ethereal.grow_sakura_tree(pos) function ethereal.grow_gnarltree(pos)
if math.random(10) == 1 then add_tree(pos, 3, 0, 3, ethereal.gnarltree)
add_tree(pos, 4, 0, 3, ethereal.sakura_tree,
{{"ethereal:sakura_leaves", "ethereal:sakura_leaves2"}})
else
add_tree(pos, 4, 0, 3, ethereal.sakura_tree)
end
end end
-- check if sapling has enough height room to grow -- check if sapling has enough height room to grow
@ -165,52 +146,40 @@ local grow_sapling = function(pos, node)
end end
-- Check if Ethereal Sapling is growing on correct substrate -- Check if Ethereal Sapling is growing on correct substrate
if node.name == "ethereal:yellow_tree_sapling" if node.name == "ethereal:uneti_tree_sapling"
and minetest.get_item_group(under, "soil") > 0 then and minetest.get_item_group(under, "soil") > 0 then
ethereal.grow_yellow_tree(pos) ethereal.grow_yellow_tree(pos)
elseif node.name == "ethereal:big_tree_sapling" elseif node.name == "ethereal:jogan_tree_sapling"
and under == "default:dirt_with_grass" then and minetest.get_item_group(under, "soil") > 0 then
ethereal.grow_big_tree(pos) ethereal.grow_big_tree(pos)
elseif node.name == "ethereal:banana_tree_sapling" elseif node.name == "ethereal:brylark_tree_sapling"
and under == "ethereal:grove_dirt" then and minetest.get_item_group(under, "soil") > 0 then
ethereal.grow_banana_tree(pos)
elseif node.name == "ethereal:frost_tree_sapling"
and under == "ethereal:crystal_dirt" then
ethereal.grow_frost_tree(pos) ethereal.grow_frost_tree(pos)
elseif node.name == "ethereal:mushroom_sapling" elseif node.name == "ethereal:mushroom_sapling"
and under == "ethereal:mushroom_dirt" then and under == "ethereal:fungus_dirt" then
ethereal.grow_mushroom_tree(pos) ethereal.grow_mushroom_tree(pos)
elseif node.name == "ethereal:palm_sapling" elseif node.name == "ethereal:palm_sapling"
and under == "default:sand" then and under == "default:sand" then
ethereal.grow_palm_tree(pos) ethereal.grow_palm_tree(pos)
elseif node.name == "ethereal:willow_sapling" elseif node.name == "ethereal:wroshyr_sapling"
and under == "ethereal:gray_dirt" then and minetest.get_item_group(under, "soil") > 0 then
ethereal.grow_willow_tree(pos)
elseif node.name == "ethereal:redwood_sapling"
and under == "default:dirt_with_dry_grass" then
ethereal.grow_redwood_tree(pos) ethereal.grow_redwood_tree(pos)
elseif node.name == "ethereal:orange_tree_sapling" elseif node.name == "ethereal:pine_tree_sapling"
and under == "ethereal:prairie_dirt" then and minetest.get_item_group(under, "soil") > 0 then
ethereal.grow_orange_tree(pos) ethereal.grow_orange_tree(pos)
elseif node.name == "ethereal:bamboo_sprout" elseif node.name == "ethereal:bamboo_sprout"
and under == "ethereal:bamboo_dirt" then and under == "ethereal:bamboo_dirt" then
ethereal.grow_bamboo_tree(pos) ethereal.grow_bamboo_tree(pos)
elseif node.name == "ethereal:birch_sapling" elseif node.name == "ethereal:gnarltree_sapling"
and under == "default:dirt_with_grass" then and minetest.get_item_group(under, "soil") > 0 then
ethereal.grow_birch_tree(pos)
elseif node.name == "ethereal:sakura_sapling"
and under == "ethereal:bamboo_dirt" then
ethereal.grow_sakura_tree(pos) ethereal.grow_sakura_tree(pos)
end end
end end