Skip to content

Commit

Permalink
culls settings (#41)
Browse files Browse the repository at this point in the history
* load all trees

* remove now sorta duplicate settings

* remove dead settings

* prune useless file

* prune dead settings
  • Loading branch information
wsor4035 authored May 27, 2024
1 parent 1b6914b commit 3e424b2
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 286 deletions.
140 changes: 0 additions & 140 deletions default_settings.txt

This file was deleted.

83 changes: 21 additions & 62 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,69 +151,28 @@ function translate_biome_defs(def, treename, index)
return deco_def
end

if moretrees.enable_beech then
minetest.register_decoration(translate_biome_defs(moretrees.beech_biome, "beech"))
end

if moretrees.enable_apple_tree then
minetest.register_decoration(translate_biome_defs(moretrees.apple_tree_biome, "apple_tree"))
end

if moretrees.enable_oak then
minetest.register_decoration(translate_biome_defs(moretrees.oak_biome, "oak"))
end

if moretrees.enable_sequoia then
minetest.register_decoration(translate_biome_defs(moretrees.sequoia_biome, "sequoia"))
end

if moretrees.enable_palm then
minetest.register_decoration(translate_biome_defs(moretrees.palm_biome, "palm"))
end

if moretrees.enable_date_palm then
minetest.register_decoration(translate_biome_defs(moretrees.date_palm_biome, "date_palm", 1))
minetest.register_decoration(translate_biome_defs(moretrees.date_palm_biome_2, "date_palm", 2))
end

if moretrees.enable_cedar then
minetest.register_decoration(translate_biome_defs(moretrees.cedar_biome, "cedar"))
end

if moretrees.enable_rubber_tree then
minetest.register_decoration(translate_biome_defs(moretrees.rubber_tree_biome, "rubber_tree"))
end

if moretrees.enable_willow then
minetest.register_decoration(translate_biome_defs(moretrees.willow_biome, "willow"))
end

if moretrees.enable_birch then
minetest.register_decoration(translate_biome_defs(moretrees.birch_biome, "birch"))
end

if moretrees.enable_spruce then
minetest.register_decoration(translate_biome_defs(moretrees.spruce_biome, "spruce"))
end

if moretrees.enable_jungle_tree then
minetest.register_decoration(translate_biome_defs(moretrees.jungletree_biome, "jungletree"))
end

if moretrees.enable_fir then
minetest.register_decoration(translate_biome_defs(moretrees.fir_biome, "fir", 1))
if minetest.get_modpath("snow") then
minetest.register_decoration(translate_biome_defs(moretrees.fir_biome_snow, "fir", 2))
end
end

if moretrees.enable_poplar then
minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome, "poplar", 1))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome_2, "poplar", 2))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome_3, "poplar", 3))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_small_biome, "poplar_small", 4))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_small_biome_2, "poplar_small", 5))
minetest.register_decoration(translate_biome_defs(moretrees.beech_biome, "beech"))
minetest.register_decoration(translate_biome_defs(moretrees.apple_tree_biome, "apple_tree"))
minetest.register_decoration(translate_biome_defs(moretrees.oak_biome, "oak"))
minetest.register_decoration(translate_biome_defs(moretrees.sequoia_biome, "sequoia"))
minetest.register_decoration(translate_biome_defs(moretrees.palm_biome, "palm"))
minetest.register_decoration(translate_biome_defs(moretrees.date_palm_biome, "date_palm", 1))
minetest.register_decoration(translate_biome_defs(moretrees.date_palm_biome_2, "date_palm", 2))
minetest.register_decoration(translate_biome_defs(moretrees.cedar_biome, "cedar"))
minetest.register_decoration(translate_biome_defs(moretrees.rubber_tree_biome, "rubber_tree"))
minetest.register_decoration(translate_biome_defs(moretrees.willow_biome, "willow"))
minetest.register_decoration(translate_biome_defs(moretrees.birch_biome, "birch"))
minetest.register_decoration(translate_biome_defs(moretrees.spruce_biome, "spruce"))
minetest.register_decoration(translate_biome_defs(moretrees.jungletree_biome, "jungletree"))
minetest.register_decoration(translate_biome_defs(moretrees.fir_biome, "fir", 1))
if minetest.get_modpath("snow") then
minetest.register_decoration(translate_biome_defs(moretrees.fir_biome_snow, "fir", 2))
end
minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome, "poplar", 1))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome_2, "poplar", 2))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_biome_3, "poplar", 3))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_small_biome, "poplar_small", 4))
minetest.register_decoration(translate_biome_defs(moretrees.poplar_small_biome_2, "poplar_small", 5))

--[[
this is purposefully wrapped in a on mods loaded callback to that it gets the proper ids
Expand Down
98 changes: 47 additions & 51 deletions node_defs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,70 +327,66 @@ for i in ipairs(moretrees.treelist) do
},
})

if moretrees.enable_stairs then
if minetest.get_modpath("moreblocks") then

-- stairsplus:register_all(modname, subname, recipeitem, {fields})
if minetest.get_modpath("moreblocks") then

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 = moretrees.treedesc[treename].trunk,
drop = treename.."_trunk",
}
)

if moretrees.enable_planks then
stairsplus:register_all(
"moretrees",
treename.."_trunk",
"moretrees:"..treename.."_trunk",
treename.."_planks",
"moretrees:"..treename.."_planks",
{
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 = moretrees.treedesc[treename].trunk,
drop = treename.."_trunk",
groups = { snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1 },
tiles = { "moretrees_"..treename.."_wood.png" },
description = moretrees.treedesc[treename].planks,
drop = treename.."_planks",
}
)
end
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"
},
moretrees.treedesc[treename].trunk_stair,
moretrees.treedesc[treename].trunk_slab,
xcompat.sounds.node_sound_wood_defaults()
)

if moretrees.enable_planks then
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 = moretrees.treedesc[treename].planks,
drop = treename.."_planks",
}
)
end
elseif minetest.get_modpath("stairs") then
if moretrees.enable_planks 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"
},
moretrees.treedesc[treename].trunk_stair,
moretrees.treedesc[treename].trunk_slab,
"moretrees_"..treename.."_planks",
"moretrees:"..treename.."_planks",
{ snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3 },
{ "moretrees_"..treename.."_wood.png" },
moretrees.treedesc[treename].planks_stair,
moretrees.treedesc[treename].planks_slab,
xcompat.sounds.node_sound_wood_defaults()
)

if moretrees.enable_planks then
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" },
moretrees.treedesc[treename].planks_stair,
moretrees.treedesc[treename].planks_slab,
xcompat.sounds.node_sound_wood_defaults()
)
end

end

end

if minetest.get_modpath("default") and moretrees.enable_fences and moretrees.enable_planks then
if minetest.get_modpath("default") and moretrees.enable_planks then
local planks_name = "moretrees:" .. treename .. "_planks"
local planks_tile = "moretrees_" .. treename .. "_wood.png"
default.register_fence("moretrees:" .. treename .. "_fence", {
Expand Down
Loading

0 comments on commit 3e424b2

Please sign in to comment.