Loot tables
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
TagRegistry,
|
||||
} from "./mod_data.ts";
|
||||
import { resolve_tags, Tags } from "./tags.ts";
|
||||
import type { LootTableJson } from "./loot.ts";
|
||||
import { register_block_item } from "./utils.ts";
|
||||
import type { ModelJson } from "./block_models.ts";
|
||||
|
||||
@@ -40,6 +41,8 @@ export interface ModData {
|
||||
effects: EffectJson[];
|
||||
// tag files, see common/tags.ts
|
||||
tags: TagJson[];
|
||||
// see common/loot.ts. missing from mods packed before there were loot tables
|
||||
loot_tables?: LootTableJson[];
|
||||
}
|
||||
|
||||
// a mod as the server lists it to clients, in load order: the .bmod players download, without its server script
|
||||
@@ -117,6 +120,9 @@ export function register_mod_data(mods: { id: string; data: ModData }[]): Recipe
|
||||
for (const json of data.effects) {
|
||||
EverythingRegistry.register<EffectJson>("effects", json.id, json);
|
||||
}
|
||||
for (const json of data.loot_tables ?? []) {
|
||||
EverythingRegistry.register<LootTableJson>("loot_tables", json.id, json);
|
||||
}
|
||||
} catch (e) {
|
||||
throw new ModLoadError(id, (e as Error).message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user