Improve growable component
This commit is contained in:
@@ -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"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user