Move farmers delight to bworld

This commit is contained in:
2026-11-01 00:49:05 -03:00
parent 4a713a85d1
commit 61693d611a
161 changed files with 403 additions and 466 deletions
+12 -12
View File
@@ -161,8 +161,8 @@ Deno.test("each crop takes its own number of watered days to grow", async () =>
assertEquals(grow(t, 0, "bworld:carrots", 3), [1, 2, 3]);
assertEquals(grow(t, 1, "bworld:potatoes", 6), [0, 1, 1, 2, 2, 3]);
assertEquals(grow(t, 2, "bworld:wheat", 7), [1, 2, 3, 4, 5, 6, 7]);
assertEquals(grow(t, -1, "farmersdelight:onions", 4), [0, 1, 2, 3]);
const cabbage = grow(t, -2, "farmersdelight:cabbages", 12);
assertEquals(grow(t, -1, "bworld:onions", 4), [0, 1, 2, 3]);
const cabbage = grow(t, -2, "bworld:cabbages", 12);
assertEquals(cabbage.at(-2), 6, "not grown a day early");
assertEquals(cabbage.at(-1), 7);
@@ -191,16 +191,16 @@ Deno.test("tomatoes take 11 days, are picked by hand, and grow back in 4", async
// they only grow in summer, which starts on day 50
t.game.set_time(49 * CYCLE_TICKS);
t.game.tick();
const ages = grow(t, 1, "farmersdelight:tomatoes", 11);
const ages = grow(t, 1, "bworld:tomatoes", 11);
assertEquals(ages.at(-1), 7);
assertEquals(ages.at(-2), 6);
t.use(1, 101, 0);
const picked = t.game.item_entities().map((e) => e.item.to_data());
assertEquals(picked.length, 1);
assertEquals(picked[0].id, "farmersdelight:tomato");
assertEquals(picked[0].id, "bworld:tomato");
assert(picked[0].count >= 1 && picked[0].count <= 2);
assertEquals(t.game.world.get_block_id(1, 101, 0), "farmersdelight:tomatoes", "the plant stays");
assertEquals(t.game.world.get_block_id(1, 101, 0), "bworld:tomatoes", "the plant stays");
assertEquals(t.state(1, 101, 0, "age"), 4, "back to a young vine");
// 3 watered mornings isn't enough, the 4th is
@@ -212,24 +212,24 @@ Deno.test("tomatoes take 11 days, are picked by hand, and grow back in 4", async
});
Deno.test("rice is planted in water, grows panicles on top without watering, and leaves its water when harvested", async () => {
const t = await setup(["farmersdelight:rice 2"]);
const t = await setup(["bworld:rice 2"]);
t.game.set_block(1, 99, 0, "bworld:dirt");
t.game.set_block(1, 100, 0, "bworld:water");
t.game.set_block(2, 100, 0, "bworld:hoed_dirt");
// not on land
t.hold("farmersdelight:rice");
t.hold("bworld:rice");
t.use(2, 100, 0);
assertEquals(t.game.world.get_block_id(2, 101, 0), "bworld:air");
// into the water, standing on the dirt under it
t.use(1, 100, 0);
assertEquals(t.game.world.get_block_id(1, 100, 0), "farmersdelight:rice");
assertEquals(t.game.world.get_block_id(1, 100, 0), "bworld:rice");
for (let day = 0; day < 3; day++) t.next_morning();
assertEquals(t.state(1, 100, 0, "age"), 3);
assertEquals(t.game.world.get_block_id(1, 101, 0), "bworld:air");
for (let day = 0; day < 3; day++) t.next_morning();
assertEquals(t.game.world.get_block_id(1, 101, 0), "farmersdelight:rice_panicles");
assertEquals(t.game.world.get_block_id(1, 101, 0), "bworld:rice_panicles");
assertEquals(t.state(1, 101, 0, "age"), 3, "fully grown after 6 days");
assertEquals(t.state(1, 100, 0, "age"), 4, "the stalk holding them up");
@@ -239,7 +239,7 @@ Deno.test("rice is planted in water, grows panicles on top without watering, and
t.game.tick();
t.game.tick();
const dropped = t.game.item_entities().map((e) => e.item.type_id).sort();
assertEquals(dropped, ["farmersdelight:rice", "farmersdelight:rice_panicle"]);
assertEquals(dropped, ["bworld:rice", "bworld:rice_panicle"]);
assertEquals(t.game.world.get_block_id(1, 100, 0), "bworld:water");
assertEquals(t.game.world.get_block_id(1, 101, 0), "bworld:air");
});
@@ -263,9 +263,9 @@ Deno.test("a crop dies into a dead bush the first morning out of its seasons", a
Deno.test("a two block crop dies whole, its top going without dropping anything", async () => {
const t = await setup();
t.game.set_block(1, 99, 0, "bworld:dirt");
t.game.set_block(1, 100, 0, "farmersdelight:rice");
t.game.set_block(1, 100, 0, "bworld:rice");
for (let day = 0; day < 6; day++) t.next_morning();
assertEquals(t.game.world.get_block_id(1, 101, 0), "farmersdelight:rice_panicles");
assertEquals(t.game.world.get_block_id(1, 101, 0), "bworld:rice_panicles");
// rice grows in autumn, dies in winter, winter starts on day 148
t.game.set_time(147 * CYCLE_TICKS - 1);