From 280bb943f9e137e896f9a4352c9071d0f55a756b Mon Sep 17 00:00:00 2001 From: Jat Date: Fri, 27 Dec 2013 17:00:45 +0100 Subject: [PATCH] Tree horizontal in 0.4.8 Use abm for fix facedir and convert tree and jungletree. --- aliases.lua | 18 ++++++++++++++++++ crafting.lua | 45 --------------------------------------------- init.lua | 20 -------------------- 3 files changed, 18 insertions(+), 65 deletions(-) diff --git a/aliases.lua b/aliases.lua index 5df0a33..ad79bd5 100644 --- a/aliases.lua +++ b/aliases.lua @@ -186,3 +186,21 @@ minetest.register_alias("moreblocks:emptybookshelf", "moreblocks:empty_bookshelf minetest.register_alias("moreblocks:junglestick", "moreblocks:jungle_stick") minetest.register_alias("moreblocks:splitstonesquare","moreblocks:split_stone_tile") minetest.register_alias("moreblocks:allfacestree","moreblocks:all_faces_tree") + +--Abm for Horizontal_tree (fix facedir) + +minetest.register_abm({ + nodenames = {"moreblocks:horizontal_tree","moreblocks:horizontal_jungle_tree"}, + interval = 1, + chance = 1, + action = function(pos, node) + local convert_facedir={7,12,9,18} + if node.name=="moreblocks:horizontal_tree" then + node.name="default:tree" + else + node.name="default:jungletree" + end + minetest.set_node(pos, {name=node.name,param2=convert_facedir[node.param2+1]}) + end, +}) + diff --git a/crafting.lua b/crafting.lua index 0410ad0..1bc98c5 100644 --- a/crafting.lua +++ b/crafting.lua @@ -181,20 +181,6 @@ minetest.register_craft({ recipe = {"default:steel_ingot", "default:stonebrick"}, }) -minetest.register_craft({ - output = "default:wood 4", - recipe = { - {"moreblocks:horizontal_tree"}, - } -}) - -minetest.register_craft({ - output = "default:junglewood 4", - recipe = { - {"moreblocks:horizontal_jungle_tree"}, - } -}) - minetest.register_craft({ output = "moreblocks:plankstone 4", recipe = { @@ -348,37 +334,6 @@ minetest.register_craft({ } }) -minetest.register_craft({ - output = "moreblocks:horizontal_tree 2", - recipe = { - {"default:tree", "", "default:tree"}, - } -}) - -minetest.register_craft({ - output = "default:tree 2", - recipe = { - {"moreblocks:horizontal_tree"}, - {"moreblocks:horizontal_tree"}, - } -}) - -minetest.register_craft({ - output = "moreblocks:horizontal_jungle_tree 2", - recipe = { - {"default:jungletree", "", "default:jungletree"}, - } -}) - -minetest.register_craft({ - output = "default:jungletree 2", - recipe = { - {"moreblocks:horizontal_jungle_tree"}, - {"moreblocks:horizontal_jungle_tree"}, - } -}) - - minetest.register_craft({ output = "moreblocks:circular_saw 1", recipe = { diff --git a/init.lua b/init.lua index 5a9c74f..40fee2a 100644 --- a/init.lua +++ b/init.lua @@ -261,26 +261,6 @@ minetest.register_node("moreblocks:fence_jungle_wood", { sounds = default.node_sound_wood_defaults(), }) -minetest.register_node("moreblocks:horizontal_tree", { - description = S("Horizontal Tree"), - tiles = {"default_tree.png", "default_tree.png", "default_tree.png^[transformR90", - "default_tree.png^[transformR90", "default_tree_top.png", "default_tree_top.png"}, - paramtype2 = "facedir", - groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, - sounds = default.node_sound_wood_defaults(), - furnace_burntime = 30, -}) - -minetest.register_node("moreblocks:horizontal_jungle_tree", { - description = S("Horizontal Jungle Tree"), - tiles = {"default_jungletree.png", "default_jungletree.png", "default_jungletree.png^[transformR90", - "default_jungletree.png^[transformR90", "default_jungletree_top.png", "default_jungletree_top.png"}, - paramtype2 = "facedir", - groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, - sounds = default.node_sound_wood_defaults(), - furnace_burntime = 30, -}) - minetest.register_node("moreblocks:all_faces_tree", { description = S("All-faces Tree"), tiles = {"default_tree_top.png"},