From: Vanessa Ezekowitz Date: Tue, 19 Mar 2013 21:01:09 +0000 (-0400) Subject: Jungle nodes are defined and used by minetest_game now, X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=f100397cfd9634ef71d62fca6f4b014ad741e073;p=zefram%2Fminetest%2Fmoretrees.git 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. --- diff --git a/leafdecay.lua b/leafdecay.lua index 1870cb6..174eb34 100644 --- a/leafdecay.lua +++ b/leafdecay.lua @@ -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 diff --git a/node_defs.lua b/node_defs.lua index 6875f7d..a6faf4a 100644 --- a/node_defs.lua +++ b/node_defs.lua @@ -23,58 +23,65 @@ 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" + }, + 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.."_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.."_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" + 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(), - paramtype2 = "facedir", - }) + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1}, + sounds = default.node_sound_defaults(), + }) + + -- 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(), + + drop = { + max_items = 1, + items = { + {items = {"moretrees:"..treename.."_sapling"}, rarity = 100 }, + {items = {"moretrees:"..treename.."_leaves"} } + } + }, + }) + end - 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(), - }) - if (fruit ~= nil) then minetest.register_node("moretrees:"..fruit, { description = fruitdesc, @@ -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("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") -minetest.register_alias("jungletree", "moretrees:jungletree_trunk") -minetest.register_alias("default:jungletree", "moretrees:jungletree_trunk") +-- 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") diff --git a/settings.lua b/settings.lua index 85a3a5d..9311cd3 100644 --- a/settings.lua +++ b/settings.lua @@ -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