Dangerous business

This commit is contained in:
2026-11-14 15:21:10 -03:00
parent 95e058d659
commit 2282abc3bc
9 changed files with 89 additions and 3 deletions
+2 -1
View File
@@ -54,8 +54,9 @@ export class EverythingRegistry {
return this.#id_to_value.get(registry)?.[id] as T;
}
// empty for a registry nothing has been added to, like blocks in a game whose mods have none
static get_registry<T>(registry: string): T[] {
return this.#id_to_value.get(registry) as T[];
return (this.#id_to_value.get(registry) ?? []) as T[];
}
// forget everything, for tests that load mods more than once