Skip to content

Commit

Permalink
make use of cool trees optional (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 authored Mar 17, 2024
1 parent 88502e9 commit e9f8cff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then

--Bald Cypress

local modpath_baldcypress = minetest.get_modpath("baldcypress")
local fallback_scheme = minetest.get_modpath("default").."/schematics/jungle_tree.mts"

minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt", "default:sand", "swaz:silt_with_grass"},
Expand All @@ -610,13 +613,15 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then
y_min = 0,
y_max = 1000,
place_offset_y = 0,
schematic = minetest.get_modpath("baldcypress").."/schematics/baldcypress.mts",
schematic = modpath_baldcypress and modpath_baldcypress.."/schematics/baldcypress.mts" or fallback_scheme,
flags = "place_center_x, place_center_z, force_placement",
rotation = "random",
})

--Willow

local modpath_willow = minetest.get_modpath("willow")

minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt", "default:sand", "swaz:silt_with_grass"},
Expand All @@ -634,7 +639,7 @@ if mg_name ~= "v6" and mg_name ~= "singlenode" then
y_min = 0,
y_max = 1000,
place_offset_y = 0,
schematic = minetest.get_modpath("willow").."/schematics/willow.mts",
schematic = modpath_willow and modpath_willow.."/schematics/willow.mts" or fallback_scheme,
flags = "place_center_x, place_center_z, force_placement",
rotation = "random",
})
Expand Down
4 changes: 2 additions & 2 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = swaz
depends = default, flowers, baldcypress, willow, farming, dye
optional_depends = stairs, basic_materials, farming, bucket
depends = default, flowers, farming, dye
optional_depends = stairs, basic_materials, farming, bucket, baldcypress, willow

0 comments on commit e9f8cff

Please sign in to comment.