| 1 | import test from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | import { BlockType } from "../../shared/definitions/tiles.js"; |
| 4 | import { oreBoulderState } from "../../shared/definitions/materialTiers.js"; |
| 5 | import |
| 6 | { |
| 7 | isChunkAtlasBakedBlock, |
| 8 | isPickablePlantBlock |
| 9 | } from "../../shared/definitions/tiles.js"; |
| 10 | |
| 11 | test("ore boulders are not chunk-atlas baked", () => |
| 12 | { |
| 13 | assert.equal(isChunkAtlasBakedBlock({ |
| 14 | typeId: BlockType.boulder, |
| 15 | state: oreBoulderState("copper") |
| 16 | }), false); |
| 17 | }); |
| 18 | |
| 19 | test("exhausted plain boulders may be chunk-atlas baked", () => |
| 20 | { |
| 21 | assert.equal(isChunkAtlasBakedBlock({ |
| 22 | typeId: BlockType.boulder, |
| 23 | state: "boulder" |
| 24 | }), true); |
| 25 | }); |
| 26 | |
| 27 | test("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 | |
| 33 | test("stone walls remain chunk-atlas baked", () => |
| 34 | { |
| 35 | assert.equal(isChunkAtlasBakedBlock({ typeId: BlockType.stoneWall }), true); |
| 36 | }); |
| 37 | |
| 38 | test("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 | |
| 44 | test("runtime campfires are not chunk-atlas baked", () => |
| 45 | { |
| 46 | assert.equal(isChunkAtlasBakedBlock({ |
| 47 | typeId: BlockType.campfire, |
| 48 | state: "pine" |
| 49 | }), false); |
| 50 | }); |
| 51 | |
| 52 | test("wooden doors are not chunk-atlas baked", () => |
| 53 | { |
| 54 | assert.equal(isChunkAtlasBakedBlock({ |
| 55 | typeId: BlockType.door, |
| 56 | state: "pine-s-closed" |
| 57 | }), false); |
| 58 | }); |