Block registry api

This commit is contained in:
2026-11-12 20:41:13 -03:00
parent e7fe663746
commit 76802ed430
39 changed files with 499 additions and 100 deletions
+3 -3
View File
@@ -80,8 +80,8 @@ Deno.test("a texture's .json is checked, packed into the .cubi and read back", a
const json = { animation: { frametime: 3, interpolate: true } };
Deno.writeTextFileSync(`${textures}/lamps/goo.json`, JSON.stringify(json));
const lamps = () => load_and_check(sources).find((m) => m.id === "lava_lamps")!;
const mod = lamps();
const lamps = async () => (await load_and_check(sources)).find((m) => m.id === "lava_lamps")!;
const mod = await lamps();
assertEquals(mod.report.errors, []);
const packed = read_mod(await pack_mod(mod), "lava_lamps.cubi");
assertEquals([...packed.texture_json!], [["lava_lamps:lamps_goo", json]]);
@@ -92,7 +92,7 @@ Deno.test("a texture's .json is checked, packed into the .cubi and read back", a
`${textures}/lamps/goo.json`,
JSON.stringify({ animation: { width: 5 } }),
);
const broken = lamps();
const broken = await lamps();
assertEquals(broken.report.errors, [
"textures/lamps/goo.json: the png is 16×64, which doesn't split into 5×16 frames",
"textures/stray.json: there's no stray.png for it to go with",