From 1b14c24ea17dabefc44627d49239378dc20c930b Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 21 Jan 2013 20:31:28 -0500 Subject: [PATCH] weeded out all the old node and texture names from jungletree and conifers mods, added aliases for backwards compatibility. All nodes are named moretrees:something_sapling, moretrees:something_trunk moretrees:something_leaves moretrees:something_planks Also, added sideways trunks for all trees and crafting recipes for them, plus added in the missing trunks -> planks recipes. --- crafts.lua | 88 ++++++++-- init.lua | 6 +- node_defs.lua | 158 ++++++++++++------ textures/Thumbs.db | Bin 6144 -> 0 bytes ...eaves.png => moretrees_conifer_leaves.png} | Bin ...ng => moretrees_conifer_leaves_bright.png} | Bin ...ling.png => moretrees_conifer_sapling.png} | Bin ..._trunk.png => moretrees_conifer_trunk.png} | Bin ...g => moretrees_conifer_trunk_reversed.png} | Bin ...top.png => moretrees_conifer_trunktop.png} | Bin ...bark.png => moretrees_jungletree_bark.png} | Bin ... => moretrees_jungletree_leaves_green.png} | Bin ...ng => moretrees_jungletree_leaves_red.png} | Bin ...=> moretrees_jungletree_leaves_yellow.png} | Bin ...g.png => moretrees_jungletree_sapling.png} | Bin textures/moretrees_jungletree_wood.png | Bin 0 -> 789 bytes 16 files changed, 185 insertions(+), 67 deletions(-) delete mode 100644 textures/Thumbs.db rename textures/{conifers_leaves.png => moretrees_conifer_leaves.png} (100%) rename textures/{conifers_leaves_special.png => moretrees_conifer_leaves_bright.png} (100%) rename textures/{conifers_sapling.png => moretrees_conifer_sapling.png} (100%) rename textures/{conifers_trunk.png => moretrees_conifer_trunk.png} (100%) rename textures/{conifers_trunk_reversed.png => moretrees_conifer_trunk_reversed.png} (100%) rename textures/{conifers_trunktop.png => moretrees_conifer_trunktop.png} (100%) rename textures/{jungletree_bark.png => moretrees_jungletree_bark.png} (100%) rename textures/{jungletree_leaves_green.png => moretrees_jungletree_leaves_green.png} (100%) rename textures/{jungletree_leaves_red.png => moretrees_jungletree_leaves_red.png} (100%) rename textures/{jungletree_leaves_yellow.png => moretrees_jungletree_leaves_yellow.png} (100%) rename textures/{jungletree_sapling.png => moretrees_jungletree_sapling.png} (100%) create mode 100644 textures/moretrees_jungletree_wood.png diff --git a/crafts.lua b/crafts.lua index 46fc41d..3f24c01 100644 --- a/crafts.lua +++ b/crafts.lua @@ -1,32 +1,96 @@ --- --- Conifers crafting definitions --- + +for i in ipairs(simple_trees) do + minetest.register_craft({ + output = "moretrees:"..simple_trees[i].."_trunk_sideways 2", + recipe = { + {"moretrees:"..simple_trees[i].."_trunk", "moretrees:"..simple_trees[i].."_trunk"} + } + }) + + minetest.register_craft({ + output = "moretrees:"..simple_trees[i].."_trunk 2", + recipe = { + {"moretrees:"..simple_trees[i].."_trunk_sideways"}, + {"moretrees:"..simple_trees[i].."_trunk_sideways"} + } + }) + + minetest.register_craft({ + type = "shapeless", + output = "moretrees:"..simple_trees[i].."_planks 4", + recipe = { + "moretrees:"..simple_trees[i].."_trunk" + } + }) + + minetest.register_craft({ + type = "shapeless", + output = "moretrees:"..simple_trees[i].."_planks 4", + recipe = { + "moretrees:"..simple_trees[i].."_trunk_sideways" + } + }) +end + +---- + +minetest.register_craft({ + output = "moretrees:jungletree_trunk_sideways 2", + recipe = { + {"default:jungletree", "default:jungletree"}, + } +}) + +minetest.register_craft({ + output = "default:jungletree 2", + recipe = { + {"moretrees:jungletree_trunk_sideways"}, + {"moretrees:jungletree_trunk_sideways"} + } +}) + +minetest.register_craft({ + output = "moretrees:jungletree_planks 4", + recipe = { + {"default:jungletree"} + } +}) + +minetest.register_craft({ + output = "moretrees:jungletree_planks 4", + recipe = { + {"moretrees:jungletree_trunk_sideways"} + } +}) + +---- + minetest.register_craft({ - output = 'node "conifers:trunk_reversed" 2', + output = "conifers:trunk_reversed 2", recipe = { - {'node "conifers:trunk"', 'node "conifers:trunk"'}, + {"conifers:trunk", "conifers:trunk"}, } }) minetest.register_craft({ - output = 'node "conifers:trunk" 2', + output = "conifers:trunk 2", recipe = { - {'node "conifers:trunk_reversed"'}, - {'node "conifers:trunk_reversed"'} + {"conifers:trunk_reversed"}, + {"conifers:trunk_reversed"} } }) minetest.register_craft({ - output = 'default:wood 4', + output = "default:wood 4", recipe = { - {'conifers:trunk'} + {"conifers:trunk"} } }) minetest.register_craft({ - output = 'default:wood 4', + output = "default:wood 4", recipe = { - {'conifers:trunk_reversed'} + {"conifers:trunk_reversed"} } }) diff --git a/init.lua b/init.lua index 6b8e2b1..d2ffa5a 100644 --- a/init.lua +++ b/init.lua @@ -29,10 +29,10 @@ -- moretrees = {} -dofile(minetest.get_modpath("moretrees").."/crafts.lua") dofile(minetest.get_modpath("moretrees").."/node_defs.lua") dofile(minetest.get_modpath("moretrees").."/tree_models.lua") dofile(minetest.get_modpath("moretrees").."/biome_defs.lua") +dofile(minetest.get_modpath("moretrees").."/crafts.lua") -- tree spawning setup @@ -90,8 +90,8 @@ end plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:birch_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_birch",nil) plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:spruce_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_spruce",nil) -plantslib:grow_plants(sapling_interval,sapling_chance,"conifers:sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_conifer",nil) -plantslib:grow_plants(sapling_interval,sapling_chance,"jungletree:sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_jungletree",nil) +plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:conifer_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_conifer",nil) +plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:jungletree_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_jungletree",nil) -- Code to spawn a birch tree diff --git a/node_defs.lua b/node_defs.lua index 9d5842c..d807f95 100644 --- a/node_defs.lua +++ b/node_defs.lua @@ -14,19 +14,19 @@ leaves = { moretrees.avoidnodes = {} table.insert(moretrees.avoidnodes, "default:jungletree") -table.insert(moretrees.avoidnodes, "jungletree:leaves_red") -table.insert(moretrees.avoidnodes, "jungletree:leaves_green") -table.insert(moretrees.avoidnodes, "jungletree:leaves_yellow") -table.insert(moretrees.avoidnodes, "conifers:trunk") -table.insert(moretrees.avoidnodes, "conifers:leaves") -table.insert(moretrees.avoidnodes, "conifers:leaves_special") +table.insert(moretrees.avoidnodes, "moretrees:jungletree_trunk") +table.insert(moretrees.avoidnodes, "moretrees:jungletree_leaves_red") +table.insert(moretrees.avoidnodes, "moretrees:jungletree_leaves_green") +table.insert(moretrees.avoidnodes, "moretrees:jungletree_leaves_yellow") +table.insert(moretrees.avoidnodes, "moretrees:conifer_trunk") +table.insert(moretrees.avoidnodes, "moretrees:conifer_leaves") +table.insert(moretrees.avoidnodes, "moretrees:conifer_leaves_bright") for i in ipairs(leaves) do local name = leaves[i] minetest.register_node("moretrees:"..leaves[i][1].."_leaves", { description = leaves[i][2], drawtype = "allfaces_optional", - visual_scale = 1.3, tiles = { "moretrees_"..leaves[i][1].."_leaves.png" }, paramtype = "light", groups = {tree=1, snappy=3, flammable=2}, @@ -71,6 +71,21 @@ for i in ipairs(trees) do sounds = default.node_sound_wood_defaults(), }) + minetest.register_node("moretrees:"..treename.."_trunk_sideways", { + description = treedesc.." Trunk (sideways)", + tiles = { + "moretrees_"..treename..".png^[transformR90", + "moretrees_"..treename..".png^[transformR90", + "moretrees_"..treename.."_top.png", + "moretrees_"..treename.."_top.png", + "moretrees_"..treename..".png^[transformR90", + "moretrees_"..treename..".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(), + }) + minetest.register_node("moretrees:"..treename.."_planks", { description = treedesc.." Planks", tiles = {"moretrees_"..treename.."_wood.png"}, @@ -117,30 +132,58 @@ for i in ipairs(trees) do end ---- For backward compatibility, jungle trees and firs ("conifers") are defined ---- separately. - -- Nodes for jungle trees -minetest.register_node(":jungletree:sapling", { +minetest.register_node("moretrees:jungletree_sapling", { description = "Jungle Tree Sapling", drawtype = "plantlike", - visual_scale = 1.0, - tiles = {"jungletree_sapling.png"}, - inventory_image = "jungletree_sapling.png", - wield_image = "default_sapling.png", + tiles = {"moretrees_jungletree_sapling.png"}, paramtype = "light", walkable = false, groups = {snappy=2,dig_immediate=3,flammable=2}, }) +minetest.register_node("moretrees:jungletree_trunk", { + description = "Jungle Tree trunk (sideways)", + tiles = { + "default_jungletree_top.png", + "default_jungletree_top.png", + "default_jungletree.png", + "default_jungletree.png", + "default_jungletree.png", + "default_jungletree.png" + }, + groups = {wood=1,snappy=2,dig_immediate=3,flammable=2}, +}) + +minetest.register_node("moretrees:jungletree_planks", { + description = "Jungle Tree Planks", + tiles = { + "moretrees_jungletree_wood.png", + }, + groups = {wood=1,snappy=2,dig_immediate=3,flammable=2}, +}) + +minetest.register_node("moretrees:jungletree_trunk_sideways", { + description = "Jungle Tree trunk (sideways)", + tiles = { + "default_jungletree.png^[transformR90", + "default_jungletree.png^[transformR90", + "default_jungletree_top.png", + "default_jungletree_top.png", + "default_jungletree.png^[transformR90", + "default_jungletree.png^[transformR90" + }, + groups = {wood=1,snappy=2,dig_immediate=3,flammable=2}, +}) + local leaves = {"green","yellow","red"} for color = 1, 3 do - local leave_name = ":jungletree:leaves_"..leaves[color] + local leave_name = "moretrees:jungletree_leaves_"..leaves[color] minetest.register_node(leave_name, { description = "Jungle Tree Leaves", drawtype = "allfaces_optional", - tiles = {"jungletree_leaves_"..leaves[color]..".png"}, + tiles = {"moretrees_jungletree_leaves_"..leaves[color]..".png"}, paramtype = "light", groups = {snappy=3, leafdecay=3, flammable=2}, drop = { @@ -148,13 +191,13 @@ for color = 1, 3 do items = { { -- player will get sapling with 1/20 chance - items = {'jungletree:sapling'}, + items = {'moretrees:jungletree_sapling'}, rarity = 20, }, { -- player will get leaves only if he get no saplings, -- this is because max_items is 1 - items = {"jungletree:leaves_"..leaves[color]}, + items = {"moretrees:jungletree_leaves_"..leaves[color]}, } } }, @@ -164,62 +207,61 @@ end -- Nodes for conifers -minetest.register_node(":conifers:trunk", { +minetest.register_node("moretrees:conifer_trunk", { description = "Conifer trunk", tile_images = { - "conifers_trunktop.png", - "conifers_trunktop.png", - "conifers_trunk.png", - "conifers_trunk.png", - "conifers_trunk.png", - "conifers_trunk.png" + "moretrees_conifer_trunktop.png", + "moretrees_conifer_trunktop.png", + "moretrees_conifer_trunk.png", + "moretrees_conifer_trunk.png", + "moretrees_conifer_trunk.png", + "moretrees_conifer_trunk.png" }, - paramtype = "facedir_simple", is_ground_content = true, groups = { tree = 1, snappy = 2, choppy = 2, oddly_breakable_by_hand = 1, - flammable = 2 + flammable = 2, + wood = 1 }, sounds = default.node_sound_wood_defaults() }) -minetest.register_node(":conifers:trunk_reversed", { +minetest.register_node("moretrees:conifer_trunk_sideways", { description = "Conifer reversed trunk", tile_images = { - "conifers_trunk_reversed.png", - "conifers_trunk_reversed.png", - "conifers_trunktop.png", - "conifers_trunktop.png", - "conifers_trunk_reversed.png", - "conifers_trunk_reversed.png" + "moretrees_conifer_trunk.png^[transformR90", + "moretrees_conifer_trunk.png^[transformR90", + "moretrees_conifer_trunktop.png", + "moretrees_conifer_trunktop.png", + "moretrees_conifer_trunk.png^[transformR90", + "moretrees_conifer_trunk.png^[transformR90" }, --inventory_image = minetest.inventorycube( --"conifers_trunk.png", --"conifers_trunktop.png", --"conifers_trunk.png" --), - paramtype = "facedir_simple", + paramtype2 = "facedir", material = minetest.digprop_woodlike(1.0), - legacy_facedir_simple = true, - is_ground_content = true, + groups = { tree = 1, snappy = 2, choppy = 2, oddly_breakable_by_hand = 1, - flammable = 2 + flammable = 2, + wood = 1 }, sounds = default.node_sound_wood_defaults() }) -minetest.register_node(":conifers:leaves", { - description = "Conifer leaves", +minetest.register_node("moretrees:conifer_leaves", { drawtype = "allfaces_optional", - visual_scale = 1.3, - tile_images = { "conifers_leaves.png" }, + description = "Conifer leaves", + tile_images = { "moretrees_conifer_leaves.png" }, paramtype = "light", groups = { snappy = 3, @@ -244,12 +286,12 @@ minetest.register_node(":conifers:leaves", { sounds = default.node_sound_leaves_defaults() }) -minetest.register_node(":conifers:leaves_special", { - description = "Bright conifer leaves", +minetest.register_node("moretrees:conifer_leaves_bright", { drawtype = "allfaces_optional", - visual_scale = 1.3, - tile_images = { "conifers_leaves_special.png" }, + description = "Bright conifer leaves", + tile_images = { "moretrees_conifer_leaves_bright.png" }, paramtype = "light", + groups = { snappy = 3, leafdecay = 3, @@ -273,13 +315,10 @@ minetest.register_node(":conifers:leaves_special", { sounds = default.node_sound_leaves_defaults() }) -minetest.register_node(":conifers:sapling", { +minetest.register_node("moretrees:conifer_sapling", { description = "Conifer sapling", drawtype = "plantlike", - visual_scale = 1.0, - tile_images = {"conifers_sapling.png"}, - inventory_image = "conifers_sapling.png", - wield_image = "conifers_sapling.png", + tile_images = {"moretrees_conifer_sapling.png"}, paramtype = "light", walkable = false, groups = { @@ -290,3 +329,18 @@ minetest.register_node(":conifers:sapling", { sounds = default.node_sound_defaults(), }) + + +-- Backward compatbility with old mods/nodes: + +minetest.register_alias("default:jungletree", "moretrees:jungletree_trunk") +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("conifers:trunk", "moretrees:conifer_trunk") +minetest.register_alias("conifers:trunk_reversed", "moretrees:conifer_trunk_sideways") +minetest.register_alias("conifers:leaves", "moretrees:conifer_leaves") +minetest.register_alias("conifers:leaves_special", "moretrees:conifer_leaves_bright") +minetest.register_alias("conifers:sapling", "moretrees:conifer_sapling") + diff --git a/textures/Thumbs.db b/textures/Thumbs.db deleted file mode 100644 index cce32de4c5e6cdff092fca38ed79da2950104670..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6144 zcmeHLe>But6n`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similarity index 100% rename from textures/conifers_leaves.png rename to textures/moretrees_conifer_leaves.png diff --git a/textures/conifers_leaves_special.png b/textures/moretrees_conifer_leaves_bright.png similarity index 100% rename from textures/conifers_leaves_special.png rename to textures/moretrees_conifer_leaves_bright.png diff --git a/textures/conifers_sapling.png b/textures/moretrees_conifer_sapling.png similarity index 100% rename from textures/conifers_sapling.png rename to textures/moretrees_conifer_sapling.png diff --git a/textures/conifers_trunk.png b/textures/moretrees_conifer_trunk.png similarity index 100% rename from textures/conifers_trunk.png rename to textures/moretrees_conifer_trunk.png diff --git a/textures/conifers_trunk_reversed.png b/textures/moretrees_conifer_trunk_reversed.png similarity index 100% rename from textures/conifers_trunk_reversed.png rename to textures/moretrees_conifer_trunk_reversed.png diff --git a/textures/conifers_trunktop.png b/textures/moretrees_conifer_trunktop.png similarity index 100% rename from textures/conifers_trunktop.png rename to textures/moretrees_conifer_trunktop.png diff --git a/textures/jungletree_bark.png b/textures/moretrees_jungletree_bark.png similarity index 100% rename from textures/jungletree_bark.png rename to textures/moretrees_jungletree_bark.png diff --git a/textures/jungletree_leaves_green.png b/textures/moretrees_jungletree_leaves_green.png similarity index 100% rename from textures/jungletree_leaves_green.png rename to textures/moretrees_jungletree_leaves_green.png diff --git a/textures/jungletree_leaves_red.png b/textures/moretrees_jungletree_leaves_red.png similarity index 100% rename from textures/jungletree_leaves_red.png rename to textures/moretrees_jungletree_leaves_red.png diff --git a/textures/jungletree_leaves_yellow.png b/textures/moretrees_jungletree_leaves_yellow.png similarity index 100% rename from textures/jungletree_leaves_yellow.png rename to textures/moretrees_jungletree_leaves_yellow.png diff --git a/textures/jungletree_sapling.png b/textures/moretrees_jungletree_sapling.png similarity index 100% rename from textures/jungletree_sapling.png rename to textures/moretrees_jungletree_sapling.png diff --git a/textures/moretrees_jungletree_wood.png b/textures/moretrees_jungletree_wood.png new file mode 100644 index 0000000000000000000000000000000000000000..f0dd5d69f91fc576f3243b8f89e283212ac4b1e9 GIT binary patch literal 789 zcmV+w1M2*VP)Px#32;bRa{vGf6951U69E94oEQKA00(qQO+^RY0TUGf0dP_!od5s=r%6OXR4C6S z#7S=)MHB$wS4&rS^)l15fER3IVoot|U=dQz1m%VhH^ec&gI|J(kisFkAvoj!1c^hW z1SNoi1&M_n#}nI`@pyV>da0_e_c-t!K6d@;a8Y9~6~<8*u>arP*2U6S7T?;|0Pyb% zb7eRC@li3FIQGw-F9V%d(*yKYB}1KWV(ZM}MSXGH+G=^W$5rxtH2vV}7q*&;Ky$_= z0L1+_!sHdk#Nza?`N{9CSpuL+^3}IL>21CD^B;3tO?AE@WGL&|GcL8#IbvI190hS7 zoi+0_8FfSuySfV;cay;-TaJZ_+oq^zBcZfeOt5XZjC8&p=-#*A ze8t}1Nj(x0MFA%Q(_$!j8u7!4?P?JPOmOBrH4d{#Fvi%!o1X)KtBYiKNyYtoeuB1) z2RlF9zVXqukGa%sGY9gnF3?-u+mualy7tbei?he*ZCxDOaz^C6tNR@pW~&TXm<;0K zPWkeQYYL$fsq?j$f8QZ=TOVGZ?BDgS43mKfGypJQ&Ef=IW6EsF literal 0 HcmV?d00001 -- 2.30.2