mirror of
https://github.com/mt-mods/moretrees.git
synced 2024-12-26 10:40:24 +01:00
Merge branch 'master' into newstuff
This commit is contained in:
commit
93248e883f
@ -2,10 +2,10 @@
|
|||||||
moretrees.beech_biome = {
|
moretrees.beech_biome = {
|
||||||
surface = "default:dirt_with_grass",
|
surface = "default:dirt_with_grass",
|
||||||
avoid_nodes = moretrees.avoidnodes,
|
avoid_nodes = moretrees.avoidnodes,
|
||||||
avoid_radius = 10,
|
avoid_radius = 8,
|
||||||
seed_diff = 2,
|
seed_diff = 2,
|
||||||
rarity = 50,
|
rarity = 50,
|
||||||
max_count = 15,
|
max_count = 20,
|
||||||
}
|
}
|
||||||
|
|
||||||
moretrees.palm_biome = {
|
moretrees.palm_biome = {
|
||||||
|
@ -13,13 +13,7 @@ moretrees.enable_birch = true
|
|||||||
moretrees.enable_spruce = true
|
moretrees.enable_spruce = true
|
||||||
moretrees.enable_jungle_tree = true
|
moretrees.enable_jungle_tree = true
|
||||||
moretrees.enable_fir = true
|
moretrees.enable_fir = true
|
||||||
|
moretrees.enable_beech = false
|
||||||
-- Enable replacement of default trees with moretrees beech.
|
|
||||||
-- Note: The code that uses this variable is in leafdecay.lua
|
|
||||||
-- because of how it interacts with settings related to that
|
|
||||||
-- function.
|
|
||||||
|
|
||||||
moretrees.enable_replace_default_trees = true
|
|
||||||
|
|
||||||
-- Set this to true to enable leaf decay of all trees except the default ones.
|
-- Set this to true to enable leaf decay of all trees except the default ones.
|
||||||
|
|
44
init.lua
44
init.lua
@ -18,23 +18,43 @@
|
|||||||
|
|
||||||
moretrees = {}
|
moretrees = {}
|
||||||
|
|
||||||
dofile(minetest.get_modpath("moretrees").."/settings.lua")
|
-- If the config file is not found in the world directory, copy the default
|
||||||
dofile(minetest.get_modpath("moretrees").."/node_defs.lua")
|
-- settings to that location and read them in.
|
||||||
dofile(minetest.get_modpath("moretrees").."/tree_models.lua")
|
|
||||||
dofile(minetest.get_modpath("moretrees").."/biome_defs.lua")
|
|
||||||
dofile(minetest.get_modpath("moretrees").."/crafts.lua")
|
|
||||||
dofile(minetest.get_modpath("moretrees").."/leafdecay.lua")
|
|
||||||
dofile(minetest.get_modpath("moretrees").."/saplings.lua")
|
|
||||||
|
|
||||||
if moretrees.enable_replace_default_trees then
|
local worldpath=minetest.get_worldpath()
|
||||||
minetest.register_alias("mapgen_tree", "air")
|
local modpath=minetest.get_modpath("moretrees")
|
||||||
minetest.register_alias("mapgen_leaves", "air")
|
|
||||||
minetest.register_alias("mapgen_apple", "air")
|
if io.open(worldpath.."/moretrees_settings.txt","r") == nil then
|
||||||
plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model)
|
|
||||||
|
dofile(modpath.."/default_settings.txt")
|
||||||
|
|
||||||
|
io.input(modpath.."/default_settings.txt")
|
||||||
|
io.output(worldpath.."/moretrees_settings.txt")
|
||||||
|
|
||||||
|
local size = 2^13 -- good buffer size (8K)
|
||||||
|
while true do
|
||||||
|
local block = io.read(size)
|
||||||
|
if not block then break end
|
||||||
|
io.write(block)
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
dofile(worldpath.."/moretrees_settings.txt")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
dofile(modpath.."/tree_models.lua")
|
||||||
|
dofile(modpath.."/biome_defs.lua")
|
||||||
|
dofile(modpath.."/node_defs.lua")
|
||||||
|
dofile(modpath.."/saplings.lua")
|
||||||
|
dofile(modpath.."/crafts.lua")
|
||||||
|
dofile(modpath.."/leafdecay.lua")
|
||||||
|
|
||||||
-- tree spawning setup
|
-- tree spawning setup
|
||||||
|
|
||||||
|
if moretrees.enable_beech then
|
||||||
|
plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model)
|
||||||
|
end
|
||||||
|
|
||||||
if moretrees.enable_apple_tree then
|
if moretrees.enable_apple_tree then
|
||||||
plantslib:register_generate_plant(moretrees.apple_tree_biome, moretrees.apple_tree_model)
|
plantslib:register_generate_plant(moretrees.apple_tree_biome, moretrees.apple_tree_model)
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
moretrees.avoidnodes = {}
|
moretrees.avoidnodes = {}
|
||||||
|
|
||||||
moretrees.treelist = {
|
moretrees.treelist = {
|
||||||
|
{"beech", "Beech Tree"},
|
||||||
{"apple_tree", "Apple Tree"},
|
{"apple_tree", "Apple Tree"},
|
||||||
{"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
{"oak", "Oak Tree", "acorn", "Acorn", {-0.2, -0.5, -0.2, 0.2, 0, 0.2}, 0.8 },
|
||||||
{"sequoia", "Giant Sequoia"},
|
{"sequoia", "Giant Sequoia"},
|
||||||
@ -251,92 +252,13 @@ if moretrees.enable_redefine_apple then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if moretrees.enable_replace_default_trees then
|
|
||||||
|
|
||||||
minetest.register_node(":default:tree", {
|
|
||||||
description = "Beech Trunk",
|
|
||||||
tiles = {"moretrees_beech_trunk_top.png", "moretrees_beech_trunk_top.png", "moretrees_beech_trunk.png"},
|
|
||||||
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
|
||||||
sounds = default.node_sound_wood_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node(":default:leaves", {
|
|
||||||
description = "Beech Leaves",
|
|
||||||
drawtype = "allfaces_optional",
|
|
||||||
visual_scale = 1.3,
|
|
||||||
tiles = {"moretrees_beech_leaves.png"},
|
|
||||||
paramtype = "light",
|
|
||||||
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
|
|
||||||
drop = {
|
|
||||||
max_items = 1,
|
|
||||||
items = {
|
|
||||||
{
|
|
||||||
-- player will get sapling with 1/20 chance
|
|
||||||
items = {'default:sapling'},
|
|
||||||
rarity = 20,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
-- player will get leaves only if he get no saplings,
|
|
||||||
-- this is because max_items is 1
|
|
||||||
items = {'default:leaves'},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node(":default:wood", {
|
|
||||||
description = "Beech Planks",
|
|
||||||
tiles = {"moretrees_beech_wood.png"},
|
|
||||||
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
|
|
||||||
sounds = default.node_sound_wood_defaults(),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node(":default:sapling", {
|
|
||||||
description = "Beech Sapling",
|
|
||||||
drawtype = "plantlike",
|
|
||||||
visual_scale = 1.0,
|
|
||||||
tiles = {"moretrees_beech_sapling.png"},
|
|
||||||
inventory_image = "moretrees_beech_sapling.png",
|
|
||||||
wield_image = "moretrees_beech_sapling.png",
|
|
||||||
paramtype = "light",
|
|
||||||
walkable = false,
|
|
||||||
selection_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
|
|
||||||
},
|
|
||||||
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
|
|
||||||
sounds = default.node_sound_defaults(),
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_node("moretrees:beech_trunk_sideways", {
|
|
||||||
description = "Sideways Beech Trunk",
|
|
||||||
tiles = {
|
|
||||||
"moretrees_beech_trunk.png^[transformR90",
|
|
||||||
"moretrees_beech_trunk.png^[transformR90",
|
|
||||||
"moretrees_beech_trunk_top.png",
|
|
||||||
"moretrees_beech_trunk_top.png",
|
|
||||||
"moretrees_beech_trunk.png^[transformR90",
|
|
||||||
"moretrees_beech_trunk.png^[transformR90"
|
|
||||||
},
|
|
||||||
is_ground_content = true,
|
|
||||||
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
|
||||||
sounds = default.node_sound_wood_defaults(),
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
})
|
|
||||||
|
|
||||||
table.insert(moretrees.avoidnodes, "default:jungletree")
|
table.insert(moretrees.avoidnodes, "default:jungletree")
|
||||||
table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk")
|
table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk")
|
||||||
table.insert(moretrees.avoidnodes, "moretrees:fir_trunk")
|
table.insert(moretrees.avoidnodes, "moretrees:fir_trunk")
|
||||||
|
table.insert(moretrees.avoidnodes, "default:tree")
|
||||||
|
|
||||||
-- For compatibility with old nodes and recently-changed nodes.
|
-- For compatibility with old nodes and recently-changed nodes.
|
||||||
|
|
||||||
minetest.register_alias("moretrees:beech_trunk", "default:tree")
|
|
||||||
minetest.register_alias("moretrees:beech_leaves", "default:leaves")
|
|
||||||
minetest.register_alias("moretrees:beech_planks", "default:wood")
|
|
||||||
minetest.register_alias("moretrees:beech_sapling", "default:sapling")
|
|
||||||
|
|
||||||
minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree")
|
minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree")
|
||||||
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
|
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
|
||||||
minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
|
minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
|
||||||
|
Loading…
Reference in New Issue
Block a user