Jungle nodes are defined and used by minetest_game now,

so we don't need them in moretrees anymore.  They're still used by moretrees
to generate out versions of jungletrees, though, and red/green/yellow leaves
are also still provided and defined.
This commit is contained in:
Vanessa Ezekowitz 2013-03-19 17:01:09 -04:00
parent 3eb576fca6
commit f100397cfd
3 changed files with 84 additions and 82 deletions

View File

@ -58,6 +58,7 @@ end
if moretrees.enable_replace_default_trees then
minetest.register_alias("mapgen_tree", "air")
minetest.register_alias("mapgen_leaves", "air")
minetest.register_alias("mapgen_apple", "air")
plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model)
elseif moretrees.enable_default_leafdecay then

View File

@ -23,57 +23,64 @@ for i in ipairs(moretrees.treelist) do
local selbox = moretrees.treelist[i][5]
local vscale = moretrees.treelist[i][6]
if treename ~= "jungletree" then -- the default game provides jungle tree nodes.
minetest.register_node("moretrees:"..treename.."_trunk", {
description = treedesc.." Trunk",
tiles = {
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk.png"
minetest.register_node("moretrees:"..treename.."_trunk", {
description = treedesc.." Trunk",
tiles = {
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk.png"
},
is_ground_content = true,
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("moretrees:"..treename.."_planks", {
description = treedesc.." Planks",
tiles = {"moretrees_"..treename.."_wood.png"},
is_ground_content = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("moretrees:"..treename.."_sapling", {
description = treedesc.." Sapling",
drawtype = "plantlike",
tiles = {"moretrees_"..treename.."_sapling.png"},
inventory_image = "moretrees_"..treename.."_sapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
is_ground_content = true,
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
sounds = default.node_sound_defaults(),
})
minetest.register_node("moretrees:"..treename.."_trunk_sideways", {
description = "Sideways "..treedesc.." Trunk",
tiles = {
"moretrees_"..treename.."_trunk.png^[transformR90",
"moretrees_"..treename.."_trunk.png^[transformR90",
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk.png^[transformR90",
"moretrees_"..treename.."_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",
})
-- player will get a sapling with 1/100 chance
-- player will get leaves only if he/she gets no saplings,
-- this is because max_items is 1
minetest.register_node("moretrees:"..treename.."_planks", {
description = treedesc.." Planks",
tiles = {"moretrees_"..treename.."_wood.png"},
is_ground_content = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("moretrees:"..treename.."_leaves", {
description = treedesc.." Leaves",
drawtype = "allfaces_optional",
tiles = { "moretrees_"..treename.."_leaves.png" },
paramtype = "light",
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
sounds = default.node_sound_leaves_defaults(),
minetest.register_node("moretrees:"..treename.."_sapling", {
description = treedesc.." Sapling",
drawtype = "plantlike",
tiles = {"moretrees_"..treename.."_sapling.png"},
inventory_image = "moretrees_"..treename.."_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(),
})
drop = {
max_items = 1,
items = {
{items = {"moretrees:"..treename.."_sapling"}, rarity = 100 },
{items = {"moretrees:"..treename.."_leaves"} }
}
},
})
end
if (fruit ~= nil) then
minetest.register_node("moretrees:"..fruit, {
@ -95,28 +102,21 @@ for i in ipairs(moretrees.treelist) do
})
end
-- player will get a sapling with 1/100 chance
-- player will get leaves only if he/she gets no saplings,
-- this is because max_items is 1
if treename ~= "jungletree" then
minetest.register_node("moretrees:"..treename.."_leaves", {
description = treedesc.." Leaves",
drawtype = "allfaces_optional",
tiles = { "moretrees_"..treename.."_leaves.png" },
paramtype = "light",
groups = {snappy=3, flammable=2, leaves=1, moretrees_leaves=1},
sounds = default.node_sound_leaves_defaults(),
drop = {
max_items = 1,
items = {
{items = {"moretrees:"..treename.."_sapling"}, rarity = 100 },
{items = {"moretrees:"..treename.."_leaves"} }
}
},
})
end
minetest.register_node("moretrees:"..treename.."_trunk_sideways", {
description = "Sideways "..treedesc.." Trunk",
tiles = {
"moretrees_"..treename.."_trunk.png^[transformR90",
"moretrees_"..treename.."_trunk.png^[transformR90",
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk_top.png",
"moretrees_"..treename.."_trunk.png^[transformR90",
"moretrees_"..treename.."_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, "moretrees:"..treename.."_trunk")
end
@ -187,19 +187,18 @@ table.insert(moretrees.avoidnodes, "default:jungletree")
table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk")
table.insert(moretrees.avoidnodes, "moretrees:fir_trunk")
-- Backward compatbility with old mods/nodes:
minetest.registered_items["jungletree"] = nil
minetest.registered_aliases["jungletree"] = nil
minetest.registered_items["default:jungletree"] = nil
minetest.registered_aliases["default:jungletree"] = nil
-- For compatibility with newly-re-introduced default jungles and related nodes.
minetest.register_alias("jungletree", "moretrees:jungletree_trunk")
minetest.register_alias("default:jungletree", "moretrees:jungletree_trunk")
minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree")
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
minetest.register_alias("jungletree:sapling", "default:junglesapling")
-- These next ones are for the old jungle trees and conifers mods.
minetest.register_alias("jungletree:leaves_green", "moretrees:jungletree_leaves_green")
minetest.register_alias("jungletree:leaves_red", "moretrees:jungletree_leaves_red")
minetest.register_alias("jungletree:leaves_yellow", "moretrees:jungletree_leaves_yellow")
minetest.register_alias("jungletree:sapling", "moretrees:jungletree_sapling")
minetest.register_alias("moretrees:conifer_trunk", "moretrees:fir_trunk")
minetest.register_alias("moretrees:conifer_trunk_sideways", "moretrees:fir_trunk_sideways")

View File

@ -1,8 +1,10 @@
-- Global configuration variables
-- Enable replacement of default trees with birch if you want but be warned -
-- due to bugs in the speed of the engine's map generator/loader, doing so\
-- will slow it WAY down.
-- Enable replacement of default trees with beech if you want but be warned -
-- due to bugs in the speed of the engine's map generator/loader, doing so
-- will slow it WAY down. 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 = false