Basic crops system
This commit is contained in:
@@ -65,6 +65,20 @@ Deno.test("check-mods finds broken mods", async () => {
|
||||
format_version: 1,
|
||||
block: { id: "broken:x", textures: "bworld:stone" },
|
||||
});
|
||||
// a model that doesn't exist, a variant for a state the block doesn't have, and a broken model
|
||||
write_json(`${mod}/blocks/plant.json`, {
|
||||
format_version: 1,
|
||||
block: { id: "broken:plant", textures: { cross: "broken:plant" }, model: "broken:no_such_model" },
|
||||
});
|
||||
write_json(`${mod}/blocks/grows.json`, {
|
||||
format_version: 1,
|
||||
block: { id: "broken:grows", textures: "broken:plant", variants: { "size=1": { y: 90 } } },
|
||||
});
|
||||
Deno.mkdirSync(`${mod}/models`);
|
||||
write_json(`${mod}/models/bad.json`, {
|
||||
format_version: 1,
|
||||
model: { id: "broken:bad", elements: [{ from: [0, 0], to: [16, 16, 16], faces: { up: { texture: "#all" } } }] },
|
||||
});
|
||||
// not json
|
||||
Deno.writeTextFileSync(`${mod}/items/bad.json`, "{ nope");
|
||||
// uses a letter the key doesn't define
|
||||
@@ -93,6 +107,10 @@ Deno.test("check-mods finds broken mods", async () => {
|
||||
has(report.errors, "item broken:no_such_item doesn't exist");
|
||||
has(report.errors, "block broken:x is also defined by broken, broken");
|
||||
has(report.errors, "items/bad.json: isn't valid json");
|
||||
has(report.errors, "model broken:no_such_model doesn't exist");
|
||||
has(report.errors, `"size=1" must be a state of this block`);
|
||||
has(report.errors, "elements[0].from must be [x, y, z]");
|
||||
has(report.errors, `elements[0].faces: "up" isn't one of`);
|
||||
has(report.errors, `pattern uses "B" but key doesn't define it`);
|
||||
has(report.errors, "textures/huge.png: is");
|
||||
has(report.errors, "scripts don't typecheck");
|
||||
|
||||
Reference in New Issue
Block a user