From 47c296847378096f20ab040f68ea78d3d3882052 Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Sun, 16 Sep 2018 16:45:35 +0200 Subject: [PATCH] Add moreblocks support. --- depends.txt | 1 + init.lua | 33 +++++++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/depends.txt b/depends.txt index 08f0a76..c4bb68c 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,4 @@ default doors? stairs? +moreblocks? diff --git a/init.lua b/init.lua index 5779a18..9adab55 100644 --- a/init.lua +++ b/init.lua @@ -150,9 +150,9 @@ minetest.register_alias("default:mg_cherry_sapling", "cherry_tree:cherry_sapling -- Crafting minetest.register_craft( { - output = 'cherry_tree:cherry_plank 4', + output = "cherry_tree:cherry_plank 4", recipe = { - {'cherry_tree:cherry_tree'}, + {"cherry_tree:cherry_tree"}, } }) @@ -357,7 +357,33 @@ if minetest.get_modpath("doors") then end -if minetest.get_modpath("stairs") then +if minetest.get_modpath("moreblocks") then + -- planks + local nodename = "cherry_tree:cherry_plank" + local ndef = table.copy(minetest.registered_nodes[nodename]) + ndef.sunlight_propagates = true + ndef.place_param2 = nil + + stairsplus:register_all( + "cherry_tree", + "cherry_plank", + nodename, + ndef + ) + + -- tree + nodename = "cherry_tree:cherry_tree" + ndef = table.copy(minetest.registered_nodes[nodename]) + ndef.sunlight_propagates = true + + stairsplus:register_all( + "cherry_tree", + "cherry_tree", + nodename, + ndef + ) + +elseif minetest.get_modpath("stairs") then -- From BFD: stairs.register_stair_and_slab( @@ -370,5 +396,4 @@ if minetest.get_modpath("stairs") then "Cherry Plank Corner Stair", default.node_sound_wood_defaults() ) - end