From 723874e20ca798e1dbe36a13f7dad9a2ee9dbcf0 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sat, 17 Jun 2023 10:26:14 -0400 Subject: [PATCH] fireflies - allow to spawn/put the net fireflies on more biomes if ethereal * if the etherealmod is detected allow to spawn/put the net/fireflies in more biomes --- mods/fireflies/depends.txt | 3 ++- mods/fireflies/init.lua | 30 ++++++++++++++++++++++++------ mods/fireflies/mod.conf | 3 ++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/mods/fireflies/depends.txt b/mods/fireflies/depends.txt index e0585b4..310d1e6 100644 --- a/mods/fireflies/depends.txt +++ b/mods/fireflies/depends.txt @@ -1,2 +1,3 @@ default -vessels \ No newline at end of file +vessels +ethereal? \ No newline at end of file diff --git a/mods/fireflies/init.lua b/mods/fireflies/init.lua index df4f570..69c5998 100644 --- a/mods/fireflies/init.lua +++ b/mods/fireflies/init.lua @@ -1,4 +1,7 @@ +-- support to more biomes if ethereal is detected +local m_eth = minetest.get_modpath("ethereal") + -- firefly minetest.register_node("fireflies:firefly", { description = "Firefly", @@ -150,6 +153,26 @@ minetest.register_decoration({ decoration = "fireflies:firefly", }) +if m_eth then + local biomes_allowed = { + "deciduous_forest", + "coniferous_forest", + "rainforest", + "rainforest_swamp", + "grassland", + "junglee", + "junglee_ocean", + "bamboo", + "mountain" + } +else + local biomes_Allowed = { + "deciduous_forest", + "coniferous_forest", + "rainforest", + "rainforest_swamp" + } + minetest.register_decoration({ deco_type = "simple", place_on = { @@ -161,12 +184,7 @@ minetest.register_decoration({ place_offset_y = 3, sidelen = 80, fill_ratio = 0.002, - biomes = { - "deciduous_forest", - "coniferous_forest", - "rainforest", - "rainforest_swamp" - }, + biomes = biomes_allowed, y_min = -1, y_max = 31000, decoration = "fireflies:firefly", diff --git a/mods/fireflies/mod.conf b/mods/fireflies/mod.conf index d4b4332..67f845d 100644 --- a/mods/fireflies/mod.conf +++ b/mods/fireflies/mod.conf @@ -1,2 +1,3 @@ name = fireflies -depends = default, vessels \ No newline at end of file +depends = default, vessels +optional_depends = ethereal \ No newline at end of file