Ensure ethereal is a compatible version if loaded (#21)

- Check that ethereal version is more than 20220424 so that it doesn't
   unload parts of this mod
 - Remove optional dependency breaking the multi-mod dependency cycle
   ethereal --> bakedclay --> flowerpot --> moretrees --> ethereal.
This commit is contained in:
Awkanimus 2022-12-12 00:26:49 -05:00 committed by GitHub
parent 7879bd8192
commit 21bdcc360b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -14,6 +14,7 @@ globals = {
"default", "default",
"dump", "dump",
"moretrees", "moretrees",
"ethereal",
} }
read_globals = { read_globals = {

View File

@ -62,6 +62,20 @@ if io.open(worldpath.."/moretrees_settings.txt","r") then
dofile(worldpath.."/moretrees_settings.txt") dofile(worldpath.."/moretrees_settings.txt")
end end
-- Validate that if ethereal exists, that it's version is greater than 20220424.
-- Lower versions of ethereal clear registered biomes and decorations during
-- initialization which results in lost content from this mod (and others)
-- depending on where they are in the mod load order.
minetest.register_on_mods_loaded(function()
if minetest.global_exists("ethereal") then
local ethereal_ver = tonumber(ethereal.version)
if (ethereal_ver and ethereal_ver < 20220424) then
error("[moretrees] The version of ethereal detected can result " ..
"in parts of this mod and others disappearing due to mod " ..
"load order. Please update ethereal.");
end
end
end)
-- infinite stacks checking -- infinite stacks checking

View File

@ -1,4 +1,4 @@
name = moretrees name = moretrees
depends = default, vessels depends = default, vessels
optional_depends = doors, stairs, moreblocks, farming, ethereal optional_depends = doors, stairs, moreblocks, farming
min_minetest_version = 5.2.0 min_minetest_version = 5.2.0