1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2025-07-04 17:10:41 +02:00
This commit is contained in:
j-r
2024-05-18 08:29:25 +02:00
committed by GitHub
3 changed files with 49 additions and 35 deletions

View File

@ -3,13 +3,15 @@ local S = minetest.get_translator("moretrees")
for i in ipairs(moretrees.treelist) do for i in ipairs(moretrees.treelist) do
local treename = moretrees.treelist[i][1] local treename = moretrees.treelist[i][1]
minetest.register_craft({ if moretrees.enable_planks then
type = "shapeless", minetest.register_craft({
output = "moretrees:"..treename.."_planks 4", type = "shapeless",
recipe = { output = "moretrees:"..treename.."_planks 4",
"moretrees:"..treename.."_trunk" recipe = {
} "moretrees:"..treename.."_trunk"
}) }
})
end
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",

View File

@ -284,13 +284,15 @@ for i in ipairs(moretrees.treelist) do
on_place = minetest.rotate_node, on_place = minetest.rotate_node,
}) })
minetest.register_node("moretrees:"..treename.."_planks", { if moretrees.enable_planks then
description = moretrees.treedesc[treename].planks, minetest.register_node("moretrees:"..treename.."_planks", {
tiles = {"moretrees_"..treename.."_wood.png"}, description = moretrees.treedesc[treename].planks,
is_ground_content = false, tiles = {"moretrees_"..treename.."_wood.png"},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, is_ground_content = false,
sounds = default.node_sound_wood_defaults(), groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
}) sounds = default.node_sound_wood_defaults(),
})
end
local moretrees_leaves_inventory_image = nil local moretrees_leaves_inventory_image = nil
local moretrees_new_leaves_waving = nil local moretrees_new_leaves_waving = nil
@ -343,17 +345,19 @@ for i in ipairs(moretrees.treelist) do
} }
) )
stairsplus:register_all( if moretrees.enable_planks then
"moretrees", stairsplus:register_all(
treename.."_planks", "moretrees",
"moretrees:"..treename.."_planks", 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" }, groups = { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1 },
description = moretrees.treedesc[treename].planks, tiles = { "moretrees_"..treename.."_wood.png" },
drop = treename.."_planks", description = moretrees.treedesc[treename].planks,
} drop = treename.."_planks",
) }
)
end
elseif minetest.get_modpath("stairs") then elseif minetest.get_modpath("stairs") then
stairs.register_stair_and_slab( stairs.register_stair_and_slab(
"moretrees_"..treename.."_trunk", "moretrees_"..treename.."_trunk",
@ -368,20 +372,22 @@ for i in ipairs(moretrees.treelist) do
default.node_sound_wood_defaults() default.node_sound_wood_defaults()
) )
stairs.register_stair_and_slab( if moretrees.enable_planks then
"moretrees_"..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.."_planks",
{ "moretrees_"..treename.."_wood.png" }, { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3 },
moretrees.treedesc[treename].planks_stair, { "moretrees_"..treename.."_wood.png" },
moretrees.treedesc[treename].planks_slab, moretrees.treedesc[treename].planks_stair,
default.node_sound_wood_defaults() moretrees.treedesc[treename].planks_slab,
) default.node_sound_wood_defaults()
)
end
end end
end end
if moretrees.enable_fences then if moretrees.enable_planks and moretrees.enable_fences then
local planks_name = "moretrees:" .. treename .. "_planks" local planks_name = "moretrees:" .. treename .. "_planks"
local planks_tile = "moretrees_" .. treename .. "_wood.png" local planks_tile = "moretrees_" .. treename .. "_wood.png"
default.register_fence("moretrees:" .. treename .. "_fence", { default.register_fence("moretrees:" .. treename .. "_fence", {

View File

@ -19,6 +19,12 @@ moretrees.enable_beech = stg:get_bool("moretrees.enable_beech", false)
--spawns tree on mapgen as saplings, legacy setting --spawns tree on mapgen as saplings, legacy setting
moretrees.spawn_saplings = stg:get_bool("moretrees.spawn_saplings", true) moretrees.spawn_saplings = stg:get_bool("moretrees.spawn_saplings", true)
--turn on/off plank variants of nodes; if disabled also disables stair and plank
--variants depending on these planks *as well as the plank crafting recipe*;
--useful for games that have only one plank type and a generic plank crafting
--recipe
moretrees.enable_planks = stg:get_bool("moretrees.enable_planks", true)
--turn on/off stair varients of nodes via moreblocks or the stair api --turn on/off stair varients of nodes via moreblocks or the stair api
moretrees.enable_stairs = stg:get_bool("moretrees.enable_stairs", true) moretrees.enable_stairs = stg:get_bool("moretrees.enable_stairs", true)