add checks for submods being present

the df_trees and df_farming checks are likely redundant, but if primordial layers are disabled someone might not have df_primordial_items installed.
This commit is contained in:
FaceDeer 2022-07-24 16:54:21 -06:00
parent 5906308d87
commit 11667e184e
1 changed files with 19 additions and 16 deletions

View File

@ -8,28 +8,31 @@ end
if df_caverns.config.restrict_trees_to_biomes then
add_biome_restrictions(df_trees, "black_cap_growth_permitted", {blackcap = true})
add_biome_restrictions(df_trees, "blood_thorn_growth_permitted", {bloodthorn = true})
add_biome_restrictions(df_trees, "fungiwood_growth_permitted", {fungiwood = true, fungispore = true})
add_biome_restrictions(df_trees, "goblin_cap_growth_permitted", {goblincap = true, towergoblin = true})
add_biome_restrictions(df_trees, "nether_cap_growth_permitted", {nethercap = true})
add_biome_restrictions(df_trees, "spore_tree_growth_permitted", {sporetree = true, fungispore = true})
add_biome_restrictions(df_trees, "tower_cap_growth_permitted", {towercap = true, towergoblin = true})
add_biome_restrictions(df_trees, "tunnel_tube_growth_permitted", {tunneltube = true})
if minetest.get_modpath("df_trees") then
add_biome_restrictions(df_trees, "black_cap_growth_permitted", {blackcap = true})
add_biome_restrictions(df_trees, "blood_thorn_growth_permitted", {bloodthorn = true})
add_biome_restrictions(df_trees, "fungiwood_growth_permitted", {fungiwood = true, fungispore = true})
add_biome_restrictions(df_trees, "goblin_cap_growth_permitted", {goblincap = true, towergoblin = true})
add_biome_restrictions(df_trees, "nether_cap_growth_permitted", {nethercap = true})
add_biome_restrictions(df_trees, "spore_tree_growth_permitted", {sporetree = true, fungispore = true})
add_biome_restrictions(df_trees, "tower_cap_growth_permitted", {towercap = true, towergoblin = true})
add_biome_restrictions(df_trees, "tunnel_tube_growth_permitted", {tunneltube = true})
end
-- Deliberately not biome-restricted
--add_biome_restrictions(df_trees, "torchspine_growth_permitted", {})
--add_biome_restrictions(df_trees, "spindlestem_growth_permitted", {})
add_biome_restrictions(df_primordial_items, "primordial_mushroom_growth_permitted", {["primordial fungus"] = true})
add_biome_restrictions(df_primordial_items, "giant_mycelium_growth_permitted", {["primordial fungus"] = true})
add_biome_restrictions(df_primordial_items, "giant_fern_growth_permitted", {["primordial jungle"] = true})
add_biome_restrictions(df_primordial_items, "jungle_mushroom_growth_permitted", {["primordial jungle"] = true})
add_biome_restrictions(df_primordial_items, "jungletree_growth_permitted", {["primordial jungle"] = true})
if minetest.get_modpath("df_primordial_items") then
add_biome_restrictions(df_primordial_items, "primordial_mushroom_growth_permitted", {["primordial fungus"] = true})
add_biome_restrictions(df_primordial_items, "giant_mycelium_growth_permitted", {["primordial fungus"] = true})
add_biome_restrictions(df_primordial_items, "giant_fern_growth_permitted", {["primordial jungle"] = true})
add_biome_restrictions(df_primordial_items, "jungle_mushroom_growth_permitted", {["primordial jungle"] = true})
add_biome_restrictions(df_primordial_items, "jungletree_growth_permitted", {["primordial jungle"] = true})
end
end
if df_caverns.config.restrict_farmables_to_biomes then
if df_caverns.config.restrict_farmables_to_biomes and minetest.get_modpath("df_farming") then
add_biome_restrictions(df_farming.growth_permitted, "df_farming:cave_wheat_seed",
{fungiwood = true, tunneltube = true, sporetree = true, fungispore = true})
add_biome_restrictions(df_farming.growth_permitted, "df_farming:dimple_cup_seed",