All the stone cutter recipes

This commit is contained in:
2026-10-12 21:07:06 -03:00
parent bea5f10a12
commit dfc6a6d77b
521 changed files with 5052 additions and 60 deletions
+23 -7
View File
@@ -100,6 +100,27 @@ export function load_order(mods: LoadedMod[]): LoadedMod[] {
return ordered;
}
// the blocks, items, entities and biomes the mods register, what tags can hold. a block is an item too unless it says
// it has none, and an item file without a texture only adds to its block's item
export function registered_ids(mods: LoadedMod[]): Record<TagRegistry, Set<string>> {
const ids: Record<TagRegistry, Set<string>> = {
blocks: new Set(["bworld:air"]),
items: new Set(),
entities: new Set(),
biomes: new Set(),
};
for (const mod of mods) {
for (const { json } of mod.blocks) {
ids.blocks.add(json.id);
if (json.item !== false) ids.items.add(json.id);
}
for (const { json } of mod.items) if (json.texture !== undefined) ids.items.add(json.id);
for (const { json } of mod.entities) ids.entities.add(json.id);
for (const { json } of mod.biomes ?? []) ids.biomes.add(json.id);
}
return ids;
}
// engine_textures are the engine: texture ids, for telling whether a texture a mod uses exists
export function check_references(mods: LoadedMod[], engine_textures: Iterable<string>) {
const block_owners = new Map<string, string[]>();
@@ -459,15 +480,10 @@ export function check_references(mods: LoadedMod[], engine_textures: Iterable<st
} catch {
// checked by the caller
}
const owners: Record<TagRegistry, Map<string, string[]>> = {
blocks: block_owners,
items: item_owners,
entities: entity_owners,
biomes: biome_owners,
};
const registered = registered_ids(mods);
const { problems } = resolve_tags(
ordered.flatMap((mod) => mod.tags.map(({ file, json }) => ({ mod: mod.id, file, json }))),
(registry, id) => (registry === "blocks" && id === "bworld:air") || owners[registry].has(id),
(registry, id) => registered[registry].has(id),
);
const by_id = new Map(mods.map((mod) => [mod.id, mod]));
for (const { mod, file, message } of problems) by_id.get(mod)!.report.errors.push(`${file}: ${message}`);