Release v0.1.4 with terrain rescanning and owner-published map updates
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 6m26s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 6m26s
This commit is contained in:
17
tests/terrain-routing.test.ts
Normal file
17
tests/terrain-routing.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { datasetSchema, usesTerrainRenderer } from "../shared/protocol";
|
||||
|
||||
test("Fabric terrain uses the standalone renderer; older captures and imports keep image processing", () => {
|
||||
const asset = (path: string) => ({ path, bytes: 1, sha256: "a".repeat(64) });
|
||||
const points = Array.from({ length: 5 }, (_, i) => ({ id: `p${i}`, x: i, y: 65, z: i }));
|
||||
const common = { format: "minegeo-dataset/v1", minecraftVersion: "1.21.11", dimension: "minecraft:overworld", source: "fabric", name: "Example", serverName: "Example", north: "-z", bounds: { minX: 0, minZ: 0, maxX: 64, maxZ: 64 }, viewpoints: points };
|
||||
const faces = ["px", "nx", "py", "ny", "pz", "nz"];
|
||||
const pngAssets = [asset("map.png"), ...points.flatMap(p => faces.map(f => asset(`${p.id}/${f}.png`)))];
|
||||
const old = datasetSchema.parse({ ...common, assets: pngAssets });
|
||||
const terrain = datasetSchema.parse({ ...common, assets: [...pngAssets, asset("terrain.json.gz")] });
|
||||
const imported = datasetSchema.parse({ ...common, mediaFormat: "webp", assets: [asset("map.webp"), ...points.flatMap(p => faces.map(f => asset(`${p.id}/${f}.webp`)))] });
|
||||
assert.equal(usesTerrainRenderer(old), false);
|
||||
assert.equal(usesTerrainRenderer(terrain), true);
|
||||
assert.equal(usesTerrainRenderer(imported), false);
|
||||
});
|
||||
Reference in New Issue
Block a user