Block registry api
This commit is contained in:
+2
-2
@@ -14,7 +14,7 @@ import { DEFAULT_REMAPS, type ImportOptions, type ImportReport } from "./importe
|
||||
import { import_tags } from "./importer/tags.ts";
|
||||
import { import_textures } from "./importer/textures.ts";
|
||||
|
||||
const KINDS: Record<string, (input: string, options: ImportOptions) => ImportReport> = {
|
||||
const KINDS: Record<string, (input: string, options: ImportOptions) => ImportReport | Promise<ImportReport>> = {
|
||||
model: import_models,
|
||||
texture: import_textures,
|
||||
blockstate: import_blocks,
|
||||
@@ -113,7 +113,7 @@ if (import.meta.main) {
|
||||
}
|
||||
const run = KINDS[kind];
|
||||
if (!run) throw new Error(`"${kind}" isn't a kind that can be imported yet: ${Object.keys(KINDS).join(", ")}`);
|
||||
const report = run(input, options);
|
||||
const report = await run(input, options);
|
||||
print_report(report);
|
||||
if (report.errors.length > 0) Deno.exit(1);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user