Wooooorld files
This commit is contained in:
@@ -154,6 +154,25 @@ Deno.test("a dimension's blocks go from its min_y to max_y - 1, and are sent and
|
||||
for (const y of [-64, 319]) assertEquals(loaded.game.world.get_block_id(GROUND_X, y, 0), "bworld:stone");
|
||||
});
|
||||
|
||||
Deno.test("a chunk saved at another height keeps the sections both heights have", async () => {
|
||||
const tall = mods({ flat: true, bworld_default: false, shape: TALL });
|
||||
const { game } = await test_game(tall);
|
||||
for (const y of [-64, 0, 255, 319]) game.set_block(GROUND_X, y, 0, "bworld:stone");
|
||||
const saved = game.save();
|
||||
|
||||
const short = mods({ flat: true, bworld_default: false });
|
||||
const { game: shorter } = await test_game(short, saved);
|
||||
for (const y of [0, 255]) assertEquals(shorter.world.get_block_id(GROUND_X, y, 0), "bworld:stone");
|
||||
assertEquals(shorter.world.get_block_id(GROUND_X, 254, 0), "cubi:air");
|
||||
shorter.set_block(GROUND_X, 1, 0, "bworld:stone");
|
||||
|
||||
// and back, where what the shorter one didn't keep is air, like a dimension that grew
|
||||
const { game: again } = await test_game(tall, shorter.save());
|
||||
for (const dir of [tall, short]) Deno.removeSync(dir, { recursive: true });
|
||||
for (const y of [0, 1, 255]) assertEquals(again.world.get_block_id(GROUND_X, y, 0), "bworld:stone");
|
||||
for (const y of [-64, 319]) assertEquals(again.world.get_block_id(GROUND_X, y, 0), "cubi:air");
|
||||
});
|
||||
|
||||
Deno.test("under a dimension's ground it's dark, above its top it's open sky, and things fall out of its bottom", async () => {
|
||||
const dir = mods({ flat: true, bworld_default: false, shape: TALL, ground: "bworld:stone" });
|
||||
const { game } = await test_game(dir);
|
||||
|
||||
Reference in New Issue
Block a user