Add all textures and models from create

This commit is contained in:
2026-10-12 18:47:41 -03:00
parent d4eff11f3e
commit 99bdcaeffc
3775 changed files with 66614 additions and 58 deletions
+21
View File
@@ -67,6 +67,27 @@ Deno.test("turning a model moves its faces and cullfaces", () => {
assert(east.flush);
});
Deno.test("an x turn tips a model's top to the north, before its y turn", () => {
// a slab's top face, culled by what's above it
const model: ModelJson = {
id: "a:slab",
elements: [{
from: [0, 0, 0],
to: [16, 8, 16],
faces: { top: { texture: "a:x" }, bottom: { texture: "a:x", cullface: "bottom" } },
}],
};
const [top, bottom] = bake_model(model, undefined, 0, 90);
assertEquals(top.face, 3);
// the bottom tips to the south, and is still against the block's edge there
assertEquals([bottom.face, bottom.cull], [2, 2]);
assert(bottom.flush);
const [east] = bake_model(model, undefined, 90, 90);
assertEquals(east.face, 5);
const [down] = bake_model(model, undefined, 0, 180);
assertEquals(down.face, 1);
});
Deno.test("variants pick textures by state", () => {
const { block } = block_from_json(JSON.parse(Deno.readTextFileSync("mods/bworld/blocks/wheat.json")).block);
assertEquals(block_variant(block, { age: 5 }).textures, { crop: "bworld:wheat_stage_5" });