BlueGit

timfa questward

Files

questward / server / tests / chunk-atlas-baked-blocks.test.js

chunk-atlas-baked-blocks.test.js

chunk-atlas-baked-blocks.test.js 1.6 KiB Download Raw
1import test from "node:test";
2import assert from "node:assert/strict";
3import { BlockType } from "../../shared/definitions/tiles.js";
4import { oreBoulderState } from "../../shared/definitions/materialTiers.js";
5import
6{
7 isChunkAtlasBakedBlock,
8 isPickablePlantBlock
9} from "../../shared/definitions/tiles.js";
10
11test("ore boulders are not chunk-atlas baked", () =>
12{
13 assert.equal(isChunkAtlasBakedBlock({
14 typeId: BlockType.boulder,
15 state: oreBoulderState("copper")
16 }), false);
17});
18
19test("exhausted plain boulders may be chunk-atlas baked", () =>
20{
21 assert.equal(isChunkAtlasBakedBlock({
22 typeId: BlockType.boulder,
23 state: "boulder"
24 }), true);
25});
26
27test("pickable plants are not chunk-atlas baked", () =>
28{
29 assert.equal(isPickablePlantBlock({ typeId: BlockType.flower, state: "red" }), true);
30 assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.flower, state: "red" }), false);
31});
32
33test("stone walls remain chunk-atlas baked", () =>
34{
35 assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.stoneWall }), true);
36});
37
38test("cliff blocks are per-tile (ground-top shader), not atlas-baked", () =>
39{
40 assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.cliff }), false);
41 assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.cliffThin }), false);
42});
43
44test("runtime campfires are not chunk-atlas baked", () =>
45{
46 assert.equal(isChunkAtlasBakedBlock({
47 typeId: BlockType.campfire,
48 state: "pine"
49 }), false);
50});
51
52test("wooden doors are not chunk-atlas baked", () =>
53{
54 assert.equal(isChunkAtlasBakedBlock({
55 typeId: BlockType.door,
56 state: "pine-s-closed"
57 }), false);
58});