Client side chunk sections
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// GameServer.use_worldgen_pool
|
||||
import { assert, assertEquals } from "@std/assert";
|
||||
import { is_within_view } from "@/common/chunk_streaming.ts";
|
||||
import { to_flat } from "@/common/section.ts";
|
||||
import { game_with_pool, load_view } from "./chunk_loading.ts";
|
||||
|
||||
// the workers and their ports live until the test closes them
|
||||
@@ -32,7 +33,11 @@ Deno.test({
|
||||
if (!is_within_view(cx, cz, player.chunks.view_distance, x, z)) continue;
|
||||
const chunk = chunks.get(`${x},${z}`);
|
||||
assert(chunk, `chunk ${x},${z} wasn't sent`);
|
||||
assertEquals(chunk.blocks, t.game.world.generated_blocks(x, z).to_flat(), `chunk ${x},${z}`);
|
||||
assertEquals(
|
||||
to_flat(chunk.sections),
|
||||
t.game.world.generated_blocks(x, z).to_flat(),
|
||||
`chunk ${x},${z}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
assert(t.pool!.generated - generated > chunks.size, "the pool made them, and their neighbors");
|
||||
|
||||
Reference in New Issue
Block a user