From 6da6bda95e57ebf217b943fd134823d95a6e6465 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 11 Feb 2013 22:07:40 -0500 Subject: made leaves depend on the trunks they spawn with to avoid decaying rather than just any trunk being enough to stop just any leaves from decaying. Re-tuned the leaf decay interval/chance values accordingly. Changed a few variables to avoid possible conflicts. Added a setting to allow one to disable the new leaf decay code. Moved sapling growth code into its own file. Minor changes to comments here and there. Got rid of simple trees list (made the code do various checks in realtime instead, since it's just startup code anyway). Fixed messed-up crafting for jungle trees; condensed most of the crafting code into main craft registry loop. Mostly fixed broken aliases of default jungletrees. --- crafts.lua | 130 +++++++------------------------------------------------------ 1 file changed, 13 insertions(+), 117 deletions(-) (limited to 'crafts.lua') diff --git a/crafts.lua b/crafts.lua index 58f41fc..1baccd1 100644 --- a/crafts.lua +++ b/crafts.lua @@ -1,38 +1,40 @@ -for i in ipairs(moretrees.simple_trees) do +for i in ipairs(moretrees.treelist) do + treename = moretrees.treelist[i][1] + minetest.register_craft({ - output = "moretrees:"..moretrees.simple_trees[i].."_trunk_sideways 2", + output = "moretrees:"..treename.."_trunk_sideways 2", recipe = { - {"moretrees:"..moretrees.simple_trees[i].."_trunk", "moretrees:"..moretrees.simple_trees[i].."_trunk"} + {"moretrees:"..treename.."_trunk", "moretrees:"..treename.."_trunk"} } }) minetest.register_craft({ - output = "moretrees:"..moretrees.simple_trees[i].."_trunk 2", + output = "moretrees:"..treename.."_trunk 2", recipe = { - {"moretrees:"..moretrees.simple_trees[i].."_trunk_sideways"}, - {"moretrees:"..moretrees.simple_trees[i].."_trunk_sideways"} + {"moretrees:"..treename.."_trunk_sideways"}, + {"moretrees:"..treename.."_trunk_sideways"} } }) minetest.register_craft({ type = "shapeless", - output = "moretrees:"..moretrees.simple_trees[i].."_planks 4", + output = "moretrees:"..treename.."_planks 4", recipe = { - "moretrees:"..moretrees.simple_trees[i].."_trunk" + "moretrees:"..treename.."_trunk" } }) minetest.register_craft({ type = "shapeless", - output = "moretrees:"..moretrees.simple_trees[i].."_planks 4", + output = "moretrees:"..treename.."_planks 4", recipe = { - "moretrees:"..moretrees.simple_trees[i].."_trunk_sideways" + "moretrees:"..treename.."_trunk_sideways" } }) end ----- jungletrees +-- extra crafting in case user has old jungle trees. minetest.register_craft({ output = "moretrees:jungletree_trunk_sideways 2", @@ -41,14 +43,6 @@ minetest.register_craft({ } }) -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 = { @@ -56,102 +50,4 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "moretrees:jungletree_planks 4", - recipe = { - {"moretrees:jungletree_trunk_sideways"} - } -}) - ----- firs -minetest.register_craft({ - output = "moretrees:fir_trunk_sideways 2", - recipe = { - {"moretrees:fir_trunk", "moretrees:fir_trunk"}, - } -}) - -minetest.register_craft({ - output = "moretrees:fir_trunk 2", - recipe = { - {"moretrees:fir_trunk_sideways"}, - {"moretrees:fir_trunk_sideways"} - } -}) - -minetest.register_craft({ - output = "moretrees:fir_planks 4", - recipe = { - {"moretrees:fir_trunk"} - } -}) - -minetest.register_craft({ - output = "moretrees:fir_planks 4", - recipe = { - {"moretrees:fir_trunk_sideways"} - } -}) - ----- spruces - -minetest.register_craft({ - output = "moretrees:spruce_trunk_sideways 2", - recipe = { - {"moretrees:spruce_trunk", "moretrees:spruce_trunk"}, - } -}) - -minetest.register_craft({ - output = "moretrees:spruce_trunk 2", - recipe = { - {"moretrees:spruce_trunk_sideways"}, - {"moretrees:spruce_trunk_sideways"} - } -}) - -minetest.register_craft({ - output = "moretrees:spruce_planks 4", - recipe = { - {"moretrees:spruce_trunk"} - } -}) - -minetest.register_craft({ - output = "moretrees:spruce_planks 4", - recipe = { - {"moretrees:spruce_trunk_sideways"} - } -}) - ----- birches - -minetest.register_craft({ - output = "moretrees:birch_trunk_sideways 2", - recipe = { - {"moretrees:birch_trunk", "moretrees:birch_trunk"}, - } -}) - -minetest.register_craft({ - output = "moretrees:birch_trunk 2", - recipe = { - {"moretrees:birch_trunk_sideways"}, - {"moretrees:birch_trunk_sideways"} - } -}) - -minetest.register_craft({ - output = "moretrees:birch_planks 4", - recipe = { - {"moretrees:birch_trunk"} - } -}) - -minetest.register_craft({ - output = "moretrees:birch_planks 4", - recipe = { - {"moretrees:birch_trunk_sideways"} - } -}) -- cgit v1.2.3