ctx.schematics.ids

This commit is contained in:
2026-11-22 16:09:11 -03:00
parent df7a1a94d6
commit 527f2fb5a7
4 changed files with 16 additions and 0 deletions
+6
View File
@@ -288,6 +288,12 @@ Deno.test("get gives a copy of a registered schematic with its id, a file's or a
assertEquals(t.game.world.get_block_id(10, 100, 20), "bworld:oak_planks");
});
Deno.test("ids gives every registered schematic's id, the files' first, without the ones that failed", async () => {
const t = await place_setup();
const ids = t.schematics.ids().filter((id) => id.startsWith("testmod:"));
assertEquals(ids, ["testmod:post", "testmod:hut", "testmod:partial"]);
});
Deno.test("a mod's schematics/<name>.cbsm files are registered as <mod id>:<name> before its scripts run", async () => {
const t = await place_setup();
assertStringIncludes(String(t.game.mods.storage.testmod?.post), "registered twice");