defer technic_cnc registrations and rm dep on it

- Resolves the multi-mod dependency cycle:
      ethereal --> bakedclay --> technic_cnc --> technic --> i3 -->
      3d_armor --> ethereal
- Defers technic_cnc registrations until after mods are loaded
- Removes dep on technic_cnc
This commit is contained in:
Awkanimus 2022-12-17 12:06:52 -05:00
parent 4af6f35734
commit 0ed5487802
2 changed files with 11 additions and 9 deletions

View File

@ -20,7 +20,6 @@ local clay = {
{"dark_green", "Dark Green"}
}
local techcnc_mod = minetest.get_modpath("technic_cnc")
local stairs_mod = minetest.get_modpath("stairs")
local stairsplus_mod = minetest.get_modpath("moreblocks")
and minetest.global_exists("stairsplus")
@ -89,13 +88,16 @@ for _, clay in pairs(clay) do
end
-- register bakedclay for use in technic_cnc mod
if techcnc_mod then
technic_cnc.register_all("bakedclay:" .. clay[1],
{cracky = 3, not_in_creative_inventory = 1},
{"baked_clay_" .. clay[1] .. ".png"},
clay[2] .. " Baked Clay")
end
-- defer registration until after all mods are loaded to avoid downstream
-- dependency cycles on ethereal.
core.register_on_mods_loaded(function()
if minetest.get_modpath("technic_cnc") then
technic_cnc.register_all("bakedclay:" .. clay[1],
{cracky = 3, not_in_creative_inventory = 1},
{"baked_clay_" .. clay[1] .. ".png"},
clay[2] .. " Baked Clay")
end
end)
end
-- Terracotta blocks

View File

@ -1,4 +1,4 @@
name = bakedclay
depends = default
optional_depends = stairs, moreblocks, lucky_block, technic_cnc, flowerpot
optional_depends = stairs, moreblocks, lucky_block, flowerpot
description = Adds the ability to bake clay into blocks and colour them with dye.