Add sell value for every block and item in the game, crazy
This commit is contained in:
@@ -181,3 +181,20 @@ Deno.test("an item can say how it looks worn, with a model for slim arms too", a
|
||||
assertEquals(item_to_json("gloves:glove", item_from_json(glove)).worn, worn);
|
||||
Deno.removeSync(dir, { recursive: true });
|
||||
});
|
||||
|
||||
Deno.test("an item without a texture must be the item of one of the mod's blocks", async () => {
|
||||
const dir = temp_mods_dir();
|
||||
create_mod("coins", "Coins", dir);
|
||||
const mod = `${dir}/coins`;
|
||||
write_json(`${mod}/items/example_block.json`, {
|
||||
format_version: 1,
|
||||
item: { id: "coins:example_block", base_sell_value: 3 },
|
||||
});
|
||||
write_json(`${mod}/items/nothing.json`, { format_version: 1, item: { id: "coins:nothing", base_sell_value: 3 } });
|
||||
|
||||
const report = (await check_mods(dir)).find((r) => r.id === "coins")!;
|
||||
assertEquals(report.errors, [
|
||||
"items/nothing.json: item coins:nothing has no texture, and no block of this mod gives it an item",
|
||||
]);
|
||||
Deno.removeSync(dir, { recursive: true });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user