Add sell value for every block and item in the game, crazy
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// registers mods' data, the same way on the server and on clients
|
||||
import { BlockRegistry, EverythingRegistry, ItemRegistry } from "./everything_registry.ts";
|
||||
import {
|
||||
add_to_block_item,
|
||||
block_from_json,
|
||||
BlockJson,
|
||||
choice_ids,
|
||||
@@ -96,7 +97,14 @@ export function register_mod_data(mods: { id: string; data: ModData }[]): Recipe
|
||||
}
|
||||
}
|
||||
for (const json of data.items) {
|
||||
EverythingRegistry.register<ItemRegistry>("items", json.id, item_from_json(json));
|
||||
if (json.texture !== undefined) {
|
||||
EverythingRegistry.register<ItemRegistry>("items", json.id, item_from_json(json));
|
||||
continue;
|
||||
}
|
||||
const block_item = EverythingRegistry.get<BlockRegistry>("blocks", json.id) &&
|
||||
EverythingRegistry.get<ItemRegistry>("items", json.id);
|
||||
if (!block_item) throw new Error(`item ${json.id} has no texture and isn't a block's item`);
|
||||
add_to_block_item(json, block_item);
|
||||
}
|
||||
for (const model of data.entity_models) {
|
||||
EverythingRegistry.register<EntityModelJson>("entity_models", model.id, model);
|
||||
|
||||
Reference in New Issue
Block a user