mirror of
https://github.com/mt-mods/moretrees.git
synced 2025-06-29 14:41:03 +02:00
Compare commits
2 Commits
2019-05-22
...
2019-06-18
Author | SHA1 | Date | |
---|---|---|---|
dde035cb5e | |||
acb534d8d0 |
11
init.lua
11
init.lua
@ -36,17 +36,6 @@ else
|
|||||||
end
|
end
|
||||||
moretrees.intllib = S
|
moretrees.intllib = S
|
||||||
|
|
||||||
-- clone node
|
|
||||||
|
|
||||||
function moretrees.clone_node(name)
|
|
||||||
local node2 = {}
|
|
||||||
local node = minetest.registered_nodes[name]
|
|
||||||
for k,v in pairs(node) do
|
|
||||||
node2[k]=v
|
|
||||||
end
|
|
||||||
return node2
|
|
||||||
end
|
|
||||||
|
|
||||||
-- infinite stacks checking
|
-- infinite stacks checking
|
||||||
|
|
||||||
if minetest.get_modpath("unified_inventory") or not
|
if minetest.get_modpath("unified_inventory") or not
|
||||||
|
@ -404,7 +404,7 @@ default.register_leafdecay({
|
|||||||
|
|
||||||
|
|
||||||
if moretrees.enable_redefine_apple then
|
if moretrees.enable_redefine_apple then
|
||||||
local appledef = moretrees.clone_node("default:apple")
|
local appledef = table.copy(minetest.registered_nodes["default:apple"])
|
||||||
appledef.groups.attached_node = 1
|
appledef.groups.attached_node = 1
|
||||||
minetest.register_node(":default:apple", appledef)
|
minetest.register_node(":default:apple", appledef)
|
||||||
end
|
end
|
||||||
|
22
saplings.lua
22
saplings.lua
@ -10,16 +10,28 @@ local dirt_surfaces = {
|
|||||||
["default:dirt_with_dry_grass"] = true,
|
["default:dirt_with_dry_grass"] = true,
|
||||||
["default:dirt_with_coniferous_litter"] = true,
|
["default:dirt_with_coniferous_litter"] = true,
|
||||||
["default:dirt_with_rainforest_litter"] = true,
|
["default:dirt_with_rainforest_litter"] = true,
|
||||||
["default:dirt_with_snow"] = true,
|
|
||||||
["woodsoils:dirt_with_leaves_1"] = true,
|
["woodsoils:dirt_with_leaves_1"] = true,
|
||||||
["woodsoils:dirt_with_leaves_2"] = true,
|
["woodsoils:dirt_with_leaves_2"] = true,
|
||||||
["woodsoils:grass_with_leaves_1"] = true,
|
["woodsoils:grass_with_leaves_1"] = true,
|
||||||
["woodsoils:grass_with_leaves_2"] = true
|
["woodsoils:grass_with_leaves_2"] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
local cold_surfaces = "default:dirt_with_snow"
|
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 = {
|
local sand_surfaces = {
|
||||||
|
set = true,
|
||||||
["default:sand"] = true,
|
["default:sand"] = true,
|
||||||
["default:desert_sand"] = true,
|
["default:desert_sand"] = true,
|
||||||
["cottages:loam"] = true,
|
["cottages:loam"] = true,
|
||||||
@ -38,7 +50,7 @@ for i in ipairs(moretrees.treelist) do
|
|||||||
or treename == "fir"
|
or treename == "fir"
|
||||||
or treename == "cedar"
|
or treename == "cedar"
|
||||||
or treename == "pine" then
|
or treename == "pine" then
|
||||||
surfaces = cold_surfaces
|
surfaces = conifer_surfaces
|
||||||
elseif string.find(treename, "palm") then
|
elseif string.find(treename, "palm") then
|
||||||
surfaces = sand_surfaces
|
surfaces = sand_surfaces
|
||||||
else
|
else
|
||||||
@ -62,13 +74,11 @@ for i in ipairs(moretrees.treelist) do
|
|||||||
grow_function = grow_function,
|
grow_function = grow_function,
|
||||||
})
|
})
|
||||||
|
|
||||||
if moretrees.spawn_saplings then
|
|
||||||
biome_lib:grow_plants({
|
biome_lib:grow_plants({
|
||||||
grow_delay = 2,
|
grow_delay = 2,
|
||||||
grow_chance = 1,
|
grow_chance = 1,
|
||||||
grow_plant = "moretrees:"..treename.."_sapling_ongen",
|
grow_plant = "moretrees:"..treename.."_sapling_ongen",
|
||||||
grow_nodes = moretrees[tree_biome].surface,
|
grow_nodes = surfaces,
|
||||||
grow_function = grow_function,
|
grow_function = grow_function,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
Reference in New Issue
Block a user