[mapgen] Fix old-style API calls, make the code runnable
parent
3732097ed6
commit
269e560db1
|
@ -66,8 +66,10 @@ local init_strongholds = function()
|
|||
strongholds_inited = true
|
||||
end
|
||||
|
||||
init_strongholds()
|
||||
|
||||
-- Stronghold generation for register_on_generated.
|
||||
local generate_strongholds = function(minp, maxp, blockseed)
|
||||
mcl_mapgen.register_chunk_generator(function(minp, maxp, blockseed)
|
||||
local pr = PseudoRandom(blockseed)
|
||||
for s=1, #strongholds do
|
||||
if not strongholds[s].generated then
|
||||
|
@ -99,8 +101,4 @@ local generate_strongholds = function(minp, maxp, blockseed)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
init_strongholds()
|
||||
|
||||
mcl_mapgen_core.register_generator("strongholds", nil, generate_strongholds, 999999)
|
||||
end, 999999)
|
||||
|
|
|
@ -78,7 +78,7 @@ end
|
|||
-- Disable natural generation in singlenode.
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
if mg_name ~= "singlenode" then
|
||||
mcl_mapgen_core.register_generator("villages", nil, function(minp, maxp, blockseed)
|
||||
mcl_mapgen.register_chunk_generator(function(minp, maxp, blockseed)
|
||||
-- don't build settlement underground
|
||||
if maxp.y < 0 then return end
|
||||
-- randomly try to build settlements
|
||||
|
|
|
@ -1089,7 +1089,7 @@ local function create_corridor_system(main_cave_coords)
|
|||
end
|
||||
|
||||
-- The rail corridor algorithm starts here
|
||||
mcl_mapgen_core.register_generator("railcorridors", nil, function(minp, maxp, blockseed, _pr)
|
||||
mcl_mapgen.register_chunk_generator(function(minp, maxp, blockseed, _pr)
|
||||
-- We re-init the randomizer for every mapchunk as we start generating in the middle of each mapchunk.
|
||||
-- We can't use the mapgen seed as this would make the algorithm depending on the order the mapchunk generate.
|
||||
InitRandomizer(blockseed)
|
||||
|
|
Loading…
Reference in New Issue