Actually fix default dimensions with multiple mods

This commit is contained in:
2026-11-15 09:53:31 -03:00
parent 2282abc3bc
commit afacd10a18
5 changed files with 16 additions and 12 deletions
+2 -8
View File
@@ -186,8 +186,6 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
"biome source": new Map(),
dimension: new Map(),
};
// the dimensions that say they're the default, only one can be
const defaults: string[] = [];
const biome_rule_owners = new Map<string, string[]>();
const all_noise_settings: NoiseSettingsJson[] = [];
const feature_owners = new Map<string, string[]>();
@@ -225,7 +223,6 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
}
for (const { json } of mod.dimensions ?? []) {
add(worldgen_owners.dimension, json.id, mod.id);
if (json.default) defaults.push(`${json.id} (${mod.id})`);
}
for (const { json } of mod.biome_sources ?? []) {
add(worldgen_owners["biome source"], json.id, mod.id);
@@ -432,11 +429,8 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
[settings.terrain.cell_height, settings.caves.cell_height],
);
if (problem) errors.push(`${file}: can't be generated by ${json.generator}: ${problem}`);
if (json.default && defaults.length > 1) {
errors.push(
`${file}: only one dimension can be the default, and these all are: ${defaults.join(", ")}`,
);
}
// whether exactly one is the default is up to the server, with the mods a world plays: a folder of mods
// can hold several games, each with its own
}
for (const { file, json } of mod.biome_sources ?? []) {
const refs = new_refs();