Improve growable component

This commit is contained in:
2026-10-10 20:12:40 -03:00
parent be05f70fb5
commit f348734a41
2 changed files with 21 additions and 2 deletions
+9
View File
@@ -350,3 +350,12 @@ Deno.test("blocks without data run on_new_day near players, once a morning", asy
t.next_morning();
assertEquals(t.game.world.get_block_id(far, 102, 0), "bworld:air");
});
Deno.test("a cactus grows a block a day until it's 4 tall", async () => {
const t = await setup();
t.game.set_block(0, 100, 0, "bworld:sand");
t.game.set_block(0, 101, 0, "bworld:cactus");
for (let day = 0; day < 6; day++) t.next_morning();
const column = [101, 102, 103, 104, 105].map((y) => t.game.world.get_block_id(0, y, 0));
assertEquals(column, ["bworld:cactus", "bworld:cactus", "bworld:cactus", "bworld:cactus", "bworld:air"]);
});