mirror of
https://github.com/mt-mods/moretrees.git
synced 2025-07-06 10:00:38 +02:00
Compare commits
1 Commits
2019-05-22
...
nalc-1.1
Author | SHA1 | Date | |
---|---|---|---|
aebc7a41b0 |
@ -122,8 +122,8 @@ moretrees.dates_item_drop_ichance = 10 -- inverse probability of ripe dates dr
|
|||||||
|
|
||||||
-- Sapling settings
|
-- Sapling settings
|
||||||
|
|
||||||
moretrees.sapling_interval = 100
|
moretrees.sapling_interval = 500
|
||||||
moretrees.sapling_chance = 5
|
moretrees.sapling_chance = 20
|
||||||
|
|
||||||
-- If this variable is set to true, drop leaves out as entities during leaf
|
-- If this variable is set to true, drop leaves out as entities during leaf
|
||||||
-- decay, rather than just disappearing them.
|
-- decay, rather than just disappearing them.
|
||||||
|
@ -212,7 +212,7 @@ for i in ipairs(moretrees.treelist) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
minetest.register_node("moretrees:"..treename.."_sapling_ongen", {
|
||||||
description = S(treedesc.." Sapling (fast growth)"),
|
description = S(treedesc.." Sapling (on-generated)"),
|
||||||
drawtype = "plantlike",
|
drawtype = "plantlike",
|
||||||
tiles = {saptex},
|
tiles = {saptex},
|
||||||
inventory_image = saptex,
|
inventory_image = saptex,
|
||||||
@ -224,7 +224,7 @@ for i in ipairs(moretrees.treelist) do
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
||||||
},
|
},
|
||||||
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
|
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,not_in_creative_inventory=1,sapling=1},
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
drop = "moretrees:"..treename.."_sapling"
|
drop = "moretrees:"..treename.."_sapling"
|
||||||
})
|
})
|
||||||
@ -360,6 +360,8 @@ end
|
|||||||
-- we need our own copy of that node, which moretrees will match against.
|
-- we need our own copy of that node, which moretrees will match against.
|
||||||
|
|
||||||
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
|
local jungle_tree = table.copy(minetest.registered_nodes["default:jungletree"])
|
||||||
|
jungle_tree.drop = jungle_tree.drop or { items = {} }
|
||||||
|
table.insert(jungle_tree.drop.items, { items = {"default:jungletree"}})
|
||||||
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
|
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
|
||||||
|
|
||||||
default.register_leafdecay({
|
default.register_leafdecay({
|
||||||
|
146
saplings.lua
146
saplings.lua
@ -1,84 +1,98 @@
|
|||||||
-- sapling growth
|
-- sapling growth
|
||||||
-- these tables only affect hand-placed saplings
|
|
||||||
-- mapgen-placed always use their biome def settings, which are much more
|
|
||||||
-- limited, in the interest of speed.
|
|
||||||
|
|
||||||
local dirt_surfaces = {
|
|
||||||
set = true,
|
|
||||||
["default:dirt"] = true,
|
|
||||||
["default:dirt_with_grass"] = true,
|
|
||||||
["default:dirt_with_dry_grass"] = true,
|
|
||||||
["default:dirt_with_coniferous_litter"] = true,
|
|
||||||
["default:dirt_with_rainforest_litter"] = true,
|
|
||||||
["woodsoils:dirt_with_leaves_1"] = true,
|
|
||||||
["woodsoils:dirt_with_leaves_2"] = true,
|
|
||||||
["woodsoils:grass_with_leaves_1"] = true,
|
|
||||||
["woodsoils:grass_with_leaves_2"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
local conifer_surfaces = {
|
|
||||||
set = true,
|
|
||||||
["default:dirt"] = true,
|
|
||||||
["default:dirt_with_grass"] = true,
|
|
||||||
["default:dirt_with_dry_grass"] = true,
|
|
||||||
["default:dirt_with_coniferous_litter"] = true,
|
|
||||||
["default:dirt_with_rainforest_litter"] = true,
|
|
||||||
["woodsoils:dirt_with_leaves_1"] = true,
|
|
||||||
["woodsoils:dirt_with_leaves_2"] = true,
|
|
||||||
["woodsoils:grass_with_leaves_1"] = true,
|
|
||||||
["woodsoils:grass_with_leaves_2"] = true,
|
|
||||||
["default:dirt_with_snow"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
local sand_surfaces = {
|
|
||||||
set = true,
|
|
||||||
["default:sand"] = true,
|
|
||||||
["default:desert_sand"] = true,
|
|
||||||
["cottages:loam"] = true,
|
|
||||||
-- note, no silver sand here.
|
|
||||||
-- too cold for a palm, too... well... sandy for anything else.
|
|
||||||
}
|
|
||||||
|
|
||||||
for i in ipairs(moretrees.treelist) do
|
for i in ipairs(moretrees.treelist) do
|
||||||
local treename = moretrees.treelist[i][1]
|
local treename = moretrees.treelist[i][1]
|
||||||
local tree_model = treename.."_model"
|
local tree_model = treename.."_model"
|
||||||
local tree_biome = treename.."_biome"
|
local tree_biome = treename.."_biome"
|
||||||
local surfaces
|
|
||||||
local grow_function = moretrees[tree_model]
|
|
||||||
|
|
||||||
if treename == "spruce"
|
if treename ~= "birch" and treename ~= "spruce" and treename ~= "fir" and treename ~= "jungletree" then
|
||||||
or treename == "fir"
|
|
||||||
or treename == "cedar"
|
biome_lib:dbg(dump(moretrees[tree_biome].surface))
|
||||||
or treename == "pine" then
|
biome_lib:grow_plants({
|
||||||
surfaces = conifer_surfaces
|
grow_delay = moretrees.sapling_interval,
|
||||||
elseif string.find(treename, "palm") then
|
grow_chance = moretrees.sapling_chance,
|
||||||
surfaces = sand_surfaces
|
grow_plant = "moretrees:"..treename.."_sapling",
|
||||||
else
|
grow_nodes = moretrees[tree_biome].surface,
|
||||||
surfaces = dirt_surfaces
|
grow_function = moretrees[tree_model],
|
||||||
|
})
|
||||||
|
|
||||||
|
if moretrees.spawn_saplings then
|
||||||
|
biome_lib:grow_plants({
|
||||||
|
grow_delay = 2,
|
||||||
|
grow_chance = 30,
|
||||||
|
grow_plant = "moretrees:"..treename.."_sapling_ongen",
|
||||||
|
grow_nodes = moretrees[tree_biome].surface,
|
||||||
|
grow_function = moretrees[tree_model],
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if treename == "spruce"
|
biome_lib:grow_plants({
|
||||||
or treename == "fir"
|
grow_delay = moretrees.sapling_interval,
|
||||||
or treename == "birch"
|
grow_chance = moretrees.sapling_chance,
|
||||||
or treename == "jungletree" then
|
grow_plant = "moretrees:birch_sapling",
|
||||||
grow_function = "moretrees.grow_"..treename
|
grow_nodes = moretrees.birch_biome.surface,
|
||||||
end
|
grow_function = "moretrees.grow_birch"
|
||||||
|
})
|
||||||
|
|
||||||
biome_lib:dbg(dump(moretrees[tree_biome].surface))
|
|
||||||
|
|
||||||
|
biome_lib:grow_plants({
|
||||||
|
grow_delay = moretrees.sapling_interval,
|
||||||
|
grow_chance = moretrees.sapling_chance,
|
||||||
|
grow_plant = "moretrees:spruce_sapling",
|
||||||
|
grow_nodes = moretrees.spruce_biome.surface,
|
||||||
|
grow_function = "moretrees.grow_spruce"
|
||||||
|
})
|
||||||
|
|
||||||
|
biome_lib:grow_plants({
|
||||||
|
grow_delay = moretrees.sapling_interval,
|
||||||
|
grow_chance = moretrees.sapling_chance,
|
||||||
|
grow_plant = "moretrees:fir_sapling",
|
||||||
|
grow_nodes = moretrees.fir_biome.surface,
|
||||||
|
grow_function = "moretrees.grow_fir"
|
||||||
|
})
|
||||||
|
|
||||||
|
biome_lib:grow_plants({
|
||||||
|
grow_delay = moretrees.sapling_interval,
|
||||||
|
grow_chance = moretrees.sapling_chance,
|
||||||
|
grow_plant = "default:junglesapling",
|
||||||
|
grow_nodes = moretrees.jungletree_biome.surface,
|
||||||
|
grow_function = "moretrees.grow_jungletree"
|
||||||
|
})
|
||||||
|
|
||||||
|
if moretrees.spawn_saplings then
|
||||||
biome_lib:grow_plants({
|
biome_lib:grow_plants({
|
||||||
grow_delay = moretrees.sapling_interval,
|
grow_delay = 2,
|
||||||
grow_chance = moretrees.sapling_chance,
|
grow_chance = 30,
|
||||||
grow_plant = "moretrees:"..treename.."_sapling",
|
grow_plant = "moretrees:jungletree_sapling_ongen",
|
||||||
grow_nodes = surfaces,
|
grow_nodes = moretrees.jungletree_biome.surface,
|
||||||
grow_function = grow_function,
|
grow_function = "moretrees.grow_jungletree"
|
||||||
})
|
})
|
||||||
|
|
||||||
biome_lib:grow_plants({
|
biome_lib:grow_plants({
|
||||||
grow_delay = 2,
|
grow_delay = 2,
|
||||||
grow_chance = 1,
|
grow_chance = 30,
|
||||||
grow_plant = "moretrees:"..treename.."_sapling_ongen",
|
grow_plant = "moretrees:fir_sapling_ongen",
|
||||||
grow_nodes = surfaces,
|
grow_nodes = moretrees.fir_biome.surface,
|
||||||
grow_function = grow_function,
|
grow_function = "moretrees.grow_fir"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
biome_lib:grow_plants({
|
||||||
|
grow_delay = 2,
|
||||||
|
grow_chance = 30,
|
||||||
|
grow_plant = "moretrees:spruce_sapling_ongen",
|
||||||
|
grow_nodes = moretrees.spruce_biome.surface,
|
||||||
|
grow_function = "moretrees.grow_spruce"
|
||||||
|
})
|
||||||
|
|
||||||
|
biome_lib:grow_plants({
|
||||||
|
grow_delay = 2,
|
||||||
|
grow_chance = 30,
|
||||||
|
grow_plant = "moretrees:birch_sapling_ongen",
|
||||||
|
grow_nodes = moretrees.birch_biome.surface,
|
||||||
|
grow_function = "moretrees.grow_birch"
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user