diff --git a/default_settings.txt b/default_settings.txt index 5c69324..29c9d24 100644 --- a/default_settings.txt +++ b/default_settings.txt @@ -22,9 +22,11 @@ moretrees.enable_beech = false moretrees.spawn_saplings = false --- Set this to true to allow usage of the stairsplus mod in moreblocks +-- Set this to true to allow defining stairs/slabs/etc. If Moreblocks is +-- installed, this will use that mod's Stairs Plus component. Otherwise, it +-- will use the default stairs mod in minetest_game, if present -moretrees.enable_stairsplus = true +moretrees.enable_stairs = true -- Set this to true if you want the plantlike drawtype for leaves, which -- improves some peoples' framerates without resorting to making leaf nodes opaque. diff --git a/depends.txt b/depends.txt index 1cd5974..3e8cf2d 100644 --- a/depends.txt +++ b/depends.txt @@ -1,5 +1,6 @@ default plants_lib +stairs? moreblocks? intllib? diff --git a/node_defs.lua b/node_defs.lua index c5ad566..cad3a07 100644 --- a/node_defs.lua +++ b/node_defs.lua @@ -173,37 +173,63 @@ for i in ipairs(moretrees.treelist) do }, }) - if minetest.get_modpath("moreblocks") and moretrees.enable_stairsplus then + if moretrees.enable_stairs then + if minetest.get_modpath("moreblocks") then --- stairsplus:register_all(modname, subname, recipeitem, {fields}) + -- stairsplus:register_all(modname, subname, recipeitem, {fields}) - stairsplus:register_all( - "moretrees", - treename.."_trunk", - "moretrees:"..treename.."_trunk", - { - groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 }, - tiles = { - "moretrees_"..treename.."_trunk_top.png", + stairsplus:register_all( + "moretrees", + treename.."_trunk", + "moretrees:"..treename.."_trunk", + { + groups = { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2, not_in_creative_inventory=1 }, + tiles = { + "moretrees_"..treename.."_trunk_top.png", + "moretrees_"..treename.."_trunk_top.png", + "moretrees_"..treename.."_trunk.png" + }, + description = S(treedesc.." Trunk"), + drop = treename.."_trunk", + } + ) + + stairsplus:register_all( + "moretrees", + treename.."_planks", + "moretrees:"..treename.."_planks", + { + groups = { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1 }, + tiles = { "moretrees_"..treename.."_wood.png" }, + description = S(treedesc.." Planks"), + drop = treename.."_planks", + } + ) + elseif minetest.get_modpath("stairs") then + stairs.register_stair_and_slab( + "moretrees_"..treename.."_trunk", + "moretrees:"..treename.."_trunk", + { snappy=1, choppy=2, oddly_breakable_by_hand=1, flammable=2 }, + { "moretrees_"..treename.."_trunk_top.png", "moretrees_"..treename.."_trunk_top.png", "moretrees_"..treename.."_trunk.png" }, - description = S(treedesc.." Trunk"), - drop = treename.."_trunk", - } - ) + S(treedesc.." Trunk Stair"), + S(treedesc.." Trunk Slab"), + default.node_sound_wood_defaults() + ) - stairsplus:register_all( - "moretrees", - treename.."_planks", - "moretrees:"..treename.."_planks", - { - groups = { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1 }, - tiles = { "moretrees_"..treename.."_wood.png" }, - description = S(treedesc.." Planks"), - drop = treename.."_planks", - } - ) + stairs.register_stair_and_slab( + "moretrees_"..treename.."_planks", + "moretrees:"..treename.."_planks", + { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3 }, + { "moretrees_"..treename.."_wood.png" }, + S(treedesc.." Planks Stair"), + S(treedesc.." Planks Slab"), + default.node_sound_wood_defaults() + ) + + end end end