Skip blocks that don't exist on schematics

This commit is contained in:
2026-11-21 09:10:43 -03:00
parent c0c182490e
commit f36176a872
6 changed files with 40 additions and 9 deletions
+7 -1
View File
@@ -509,7 +509,13 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
}
// cubi: entities, like dropped items, are the engine's
for (const { file, json } of mod.schematics) {
for (const { id } of json.palette) uses(file, id, "block");
// the server skips blocks that don't exist, so a schematic still loads without the mod they came from
for (const id of new Set(json.palette.map((entry) => entry.id))) {
check_namespace(file, id);
if (!block_owners.has(id)) {
warnings.push(`${file}: block ${id} doesn't exist, it will be left out`);
}
}
for (const { id } of json.entities) {
check_namespace(file, id);
if (!id.startsWith("cubi:") && !entity_owners.has(id)) {