From e9f8cff8033131d9c99ab155740a1cbe578ad052 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Sun, 17 Mar 2024 18:44:05 -0400 Subject: [PATCH] make use of cool trees optional (#2) --- init.lua | 9 +++++++-- mod.conf | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 97716c0..08077fc 100644 --- a/init.lua +++ b/init.lua @@ -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"}, @@ -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"}, @@ -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", }) diff --git a/mod.conf b/mod.conf index d4ddd2a..cd95d08 100644 --- a/mod.conf +++ b/mod.conf @@ -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