Fail fast on missing terrain assets and recover empty renders
This commit is contained in:
@@ -225,6 +225,11 @@ export async function buildTerrain(
|
||||
);
|
||||
}
|
||||
const modelMs = performance.now() - started - indexMs;
|
||||
if (!materials.size || !entries.some(([, entry]) => entry.faces.length)) {
|
||||
throw new Error(
|
||||
`No terrain models could be rendered. Minecraft models/textures are missing or failed to load. Run npm run setup. Unsupported examples: ${[...unsupported].slice(0, 8).join(", ")}`,
|
||||
);
|
||||
}
|
||||
await progress(35, "Building cached block faces", true);
|
||||
const batches = new Map(),
|
||||
meshList = [],
|
||||
@@ -299,6 +304,11 @@ export async function buildTerrain(
|
||||
);
|
||||
}
|
||||
window.terrainBounds = snapshot.bounds;
|
||||
if (!meshList.length || !emittedFaces) {
|
||||
throw new Error(
|
||||
"Terrain renderer produced no visible geometry. The export cannot be accepted as a playable map.",
|
||||
);
|
||||
}
|
||||
window.terrainMeshes = meshList;
|
||||
const totalMs = performance.now() - started;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user