simplify default biome/decor removal
This commit is contained in:
parent
bd1edcf9cc
commit
54570a8223
@ -29,34 +29,59 @@ end
|
|||||||
|
|
||||||
-- create list of default biomes to remove
|
-- create list of default biomes to remove
|
||||||
local def_biomes = {
|
local def_biomes = {
|
||||||
"rainforest_swamp", "grassland_dunes", "cold_desert", "taiga", "icesheet_ocean",
|
["rainforest_swamp"] = 1,
|
||||||
"snowy_grassland_under", "desert", "deciduous_forest", "taiga_ocean", "desert_ocean",
|
["grassland_dunes"] = 1,
|
||||||
"tundra_ocean", "snowy_grassland_ocean", "sandstone_desert", "tundra_under",
|
["cold_desert"] = 1,
|
||||||
"coniferous_forest_ocean", "tundra", "sandstone_desert_under", "grassland",
|
["taiga"] = 1,
|
||||||
"rainforest", "grassland_ocean", "tundra_beach", "rainforest_under", "savanna_under",
|
["icesheet_ocean"] = 1,
|
||||||
"icesheet", "savanna_ocean", "tundra_highland", "savanna", "cold_desert_under",
|
["snowy_grassland_under"] = 1,
|
||||||
"cold_desert_ocean", "desert_under", "taiga_under", "savanna_shore",
|
["desert"] = 1,
|
||||||
"sandstone_desert_ocean", "snowy_grassland", "coniferous_forest_under",
|
["deciduous_forest"] = 1,
|
||||||
"deciduous_forest_ocean", "grassland_under", "icesheet_under", "rainforest_ocean",
|
["taiga_ocean"] = 1,
|
||||||
"deciduous_forest_shore", "deciduous_forest_under", "coniferous_forest_dunes",
|
["desert_ocean"] = 1,
|
||||||
"coniferous_forest"
|
["tundra_ocean"] = 1,
|
||||||
|
["snowy_grassland_ocean"] = 1,
|
||||||
|
["sandstone_desert"] = 1,
|
||||||
|
["tundra_under"] = 1,
|
||||||
|
["coniferous_forest_ocean"] = 1,
|
||||||
|
["tundra"] = 1,
|
||||||
|
["sandstone_desert_under"] = 1,
|
||||||
|
["grassland"] = 1,
|
||||||
|
["rainforest"] = 1,
|
||||||
|
["grassland_ocean"] = 1,
|
||||||
|
["tundra_beach"] = 1,
|
||||||
|
["rainforest_under"] = 1,
|
||||||
|
["savanna_under"] = 1,
|
||||||
|
["icesheet"] = 1,
|
||||||
|
["savanna_ocean"] = 1,
|
||||||
|
["tundra_highland"] = 1,
|
||||||
|
["savanna"] = 1,
|
||||||
|
["cold_desert_under"] = 1,
|
||||||
|
["cold_desert_ocean"] = 1,
|
||||||
|
["desert_under"] = 1,
|
||||||
|
["taiga_under"] = 1,
|
||||||
|
["savanna_shore"] = 1,
|
||||||
|
["sandstone_desert_ocean"] = 1,
|
||||||
|
["snowy_grassland"] = 1,
|
||||||
|
["coniferous_forest_under"] = 1,
|
||||||
|
["deciduous_forest_ocean"] = 1,
|
||||||
|
["grassland_under"] = 1,
|
||||||
|
["icesheet_under"] = 1,
|
||||||
|
["rainforest_ocean"] = 1,
|
||||||
|
["deciduous_forest_shore"] = 1,
|
||||||
|
["deciduous_forest_under"] = 1,
|
||||||
|
["coniferous_forest_dunes"] = 1,
|
||||||
|
["coniferous_forest"] = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
-- only re-register biomes that aren't on the list
|
-- only re-register biomes that aren't on the list
|
||||||
for key, def in pairs(old_biomes) do
|
for key, def in pairs(old_biomes) do
|
||||||
|
|
||||||
local can_add = true
|
if not def_biomes[key] then
|
||||||
|
|
||||||
for num, bio in pairs(def_biomes) do
|
|
||||||
|
|
||||||
if key == bio then
|
|
||||||
can_add = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if can_add == true then
|
|
||||||
minetest.register_biome(def)
|
minetest.register_biome(def)
|
||||||
|
else
|
||||||
|
-- print("-- biome", key, "removed!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -70,22 +95,19 @@ for key, def in pairs(old_decor) do
|
|||||||
|
|
||||||
for num, bio in pairs(def.biomes) do
|
for num, bio in pairs(def.biomes) do
|
||||||
|
|
||||||
can_add = true
|
if def_biomes[bio] then
|
||||||
|
can_add = false ; break
|
||||||
for n, b in pairs(def_biomes) do
|
|
||||||
|
|
||||||
if bio == b then
|
|
||||||
can_add = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if def.biomes == key then
|
if def_biomes[def.biomes] then
|
||||||
can_add = false
|
can_add = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if can_add == true then
|
if can_add == true then
|
||||||
minetest.register_decoration(def)
|
minetest.register_decoration(def)
|
||||||
|
else
|
||||||
|
-- print("-- decor", key, "removed!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user