1
0
Fork 0

Make all saplings grow (but not correct shape)

This commit is contained in:
Wuzzy 2017-03-08 02:00:17 +01:00
parent 1cf9e3701d
commit 6f8eedcf63
1 changed files with 39 additions and 2 deletions

View File

@ -411,8 +411,6 @@ minetest.register_abm({
-------------------------- --------------------------
-- Try generate tree --- -- Try generate tree ---
-------------------------- --------------------------
-- TODO: Acacia, dark oak, spruce, birch
local treelight = 9 local treelight = 9
local sapling_grow_action = function(trunknode, leafnode, tree_id, soil_needed) local sapling_grow_action = function(trunknode, leafnode, tree_id, soil_needed)
@ -436,6 +434,9 @@ local sapling_grow_action = function(trunknode, leafnode, tree_id, soil_needed)
end end
end end
-- TODO: Use better tree models for everything
-- TODO: Support 2×2 saplings
-- Oak tree -- Oak tree
minetest.register_abm({ minetest.register_abm({
nodenames = {"mcl_core:sapling"}, nodenames = {"mcl_core:sapling"},
@ -445,6 +446,15 @@ minetest.register_abm({
action = sapling_grow_action("mcl_core:tree", "mcl_core:leaves", 1, 1), action = sapling_grow_action("mcl_core:tree", "mcl_core:leaves", 1, 1),
}) })
-- Dark oak tree
minetest.register_abm({
nodenames = {"mcl_core:darksapling"},
neighbors = {"group:soil_sapling"},
interval = 20,
chance = 1,
action = sapling_grow_action("mcl_core:darktree", "mcl_core:darkleaves", 1, 2),
})
-- Jungle Tree -- Jungle Tree
minetest.register_abm({ minetest.register_abm({
nodenames = {"mcl_core:junglesapling"}, nodenames = {"mcl_core:junglesapling"},
@ -454,6 +464,33 @@ minetest.register_abm({
action = sapling_grow_action("mcl_core:jungletree", "mcl_core:jungleleaves", 1, 2) action = sapling_grow_action("mcl_core:jungletree", "mcl_core:jungleleaves", 1, 2)
}) })
-- Spruce tree
minetest.register_abm({
nodenames = {"mcl_core:sprucesapling"},
neighbors = {"group:soil_sapling"},
interval = 20,
chance = 1,
action = sapling_grow_action("mcl_core:sprucetree", "mcl_core:spruceleaves", 1, 1),
})
-- Birch tree
minetest.register_abm({
nodenames = {"mcl_core:birchsapling"},
neighbors = {"group:soil_sapling"},
interval = 20,
chance = 1,
action = sapling_grow_action("mcl_core:birchtree", "mcl_core:birchleaves", 1, 1),
})
-- Acacia tree
minetest.register_abm({
nodenames = {"mcl_core:acaciasapling"},
neighbors = {"group:soil_sapling"},
interval = 20,
chance = 1,
action = sapling_grow_action("mcl_core:acaciatree", "mcl_core:acacialeaves", 1, 2),
})
--------------------- ---------------------
-- Vine generating -- -- Vine generating --
--------------------- ---------------------