Insert mapgen callback in first position, to ensure it is called first

Improves compatibility with mods working on mapgen
This commit is contained in:
Gaël C 2024-02-07 10:54:31 +01:00
parent 146f009684
commit a91a13bbec

View File

@ -262,7 +262,9 @@ function mapgen_rivers.make_chunk(minp, maxp, seed)
minetest.log("verbose", ("[mapgen_rivers] Done in %5.3f s"):format(t))
end
minetest.register_on_generated(mapgen_rivers.make_chunk)
-- Enforce first position in mapgen callbacks
table.insert(minetest.registered_on_generateds, 1, mapgen_rivers.make_chunk)
--minetest.register_on_generated(mapgen_rivers.make_chunk)
minetest.register_on_shutdown(function()
local avg = sumtime / ngen