diff --git a/mods/bworld/blocks/beetroots.json b/mods/bworld/blocks/beetroots.json new file mode 100644 index 0000000..cd11cc7 --- /dev/null +++ b/mods/bworld/blocks/beetroots.json @@ -0,0 +1,80 @@ +{ + "format_version": 1, + "block": { + "id": "bworld:beetroots", + "textures": { + "crop": "bworld:beetroot_stage_0" + }, + "model": "engine:crop", + "variants": { + "age=0": { + "textures": { + "crop": "bworld:beetroot_stage_0" + } + }, + "age=1": { + "textures": { + "crop": "bworld:beetroot_stage_1" + } + }, + "age=2": { + "textures": { + "crop": "bworld:beetroot_stage_2" + } + }, + "age=3": { + "textures": { + "crop": "bworld:beetroot_stage_3" + } + }, + "age=4": { + "textures": { + "crop": "bworld:beetroot_stage_4" + } + }, + "age=5": { + "textures": { + "crop": "bworld:beetroot_stage_5" + } + }, + "age=6": { + "textures": { + "crop": "bworld:beetroot_stage_6" + } + }, + "age=7": { + "textures": { + "crop": "bworld:beetroot_stage_7" + } + } + }, + "render_layer": "cutout", + "collision": false, + "mining": { + "toughness": 0 + }, + "loot_table": "bworld:blocks/beetroots", + "item": false, + "place_on": [ + "bworld:hoed_dirt" + ], + "states": [ + { + "name": "age", + "bits": 3, + "default": 0 + } + ], + "components": { + "bworld:crop": { + "days": 6, + "stages": 8, + "fertilizer": "bworld:bone_meal", + "seasons": [ + "spring", + "autumn" + ] + } + } + } +} diff --git a/mods/bworld/blocks/cotton.json b/mods/bworld/blocks/cotton.json new file mode 100644 index 0000000..f1dad4f --- /dev/null +++ b/mods/bworld/blocks/cotton.json @@ -0,0 +1,82 @@ +{ + "format_version": 1, + "block": { + "id": "bworld:cotton", + "textures": { + "cross": "bworld:cotton_stage_0" + }, + "model": "engine:cross", + "variants": { + "age=0": { + "textures": { + "cross": "bworld:cotton_stage_0" + } + }, + "age=1": { + "textures": { + "cross": "bworld:cotton_stage_1" + } + }, + "age=2": { + "textures": { + "cross": "bworld:cotton_stage_2" + } + }, + "age=3": { + "textures": { + "cross": "bworld:cotton_stage_3" + } + }, + "age=4": { + "textures": { + "cross": "bworld:cotton_stage_4" + } + }, + "age=5": { + "textures": { + "cross": "bworld:cotton_stage_5" + } + }, + "age=6": { + "textures": { + "cross": "bworld:cotton_stage_6" + } + }, + "age=7": { + "textures": { + "cross": "bworld:cotton_stage_7" + } + } + }, + "render_layer": "cutout", + "collision": false, + "mining": { + "toughness": 0 + }, + "loot_table": "bworld:blocks/cotton", + "item": false, + "place_on": [ + "bworld:hoed_dirt" + ], + "states": [ + { + "name": "age", + "bits": 3, + "default": 0 + } + ], + "components": { + "bworld:crop": { + "days": 10, + "stages": 8, + "fertilizer": "bworld:bone_meal", + "regrow_days": 3, + "harvest": "bworld:harvest/cotton", + "seasons": [ + "summer", + "autumn" + ] + } + } + } +} diff --git a/mods/bworld/blocks/strawberries.json b/mods/bworld/blocks/strawberries.json new file mode 100644 index 0000000..05e01a7 --- /dev/null +++ b/mods/bworld/blocks/strawberries.json @@ -0,0 +1,71 @@ +{ + "format_version": 1, + "block": { + "id": "bworld:strawberries", + "textures": { + "cross": "bworld:strawberry_stage_0" + }, + "model": "engine:cross", + "variants": { + "age=0": { + "textures": { + "cross": "bworld:strawberry_stage_0" + } + }, + "age=1": { + "textures": { + "cross": "bworld:strawberry_stage_1" + } + }, + "age=2": { + "textures": { + "cross": "bworld:strawberry_stage_2" + } + }, + "age=3": { + "textures": { + "cross": "bworld:strawberry_stage_3" + } + }, + "age=4": { + "textures": { + "cross": "bworld:strawberry_stage_4" + } + }, + "age=5": { + "textures": { + "cross": "bworld:strawberry_stage_5" + } + } + }, + "render_layer": "cutout", + "collision": false, + "mining": { + "toughness": 0 + }, + "loot_table": "bworld:blocks/strawberries", + "item": false, + "place_on": [ + "bworld:hoed_dirt" + ], + "states": [ + { + "name": "age", + "bits": 3, + "default": 0 + } + ], + "components": { + "bworld:crop": { + "days": 8, + "stages": 6, + "fertilizer": "bworld:bone_meal", + "regrow_days": 4, + "harvest": "bworld:harvest/strawberries", + "seasons": [ + "spring" + ] + } + } + } +} diff --git a/mods/bworld/items/beetroot.json b/mods/bworld/items/beetroot.json new file mode 100644 index 0000000..94a7a58 --- /dev/null +++ b/mods/bworld/items/beetroot.json @@ -0,0 +1,13 @@ +{ + "format_version": 1, + "item": { + "id": "bworld:beetroot", + "texture": "bworld:beetroot", + "food": { + "nutrition": 1, + "saturation_modifier": 0.6 + }, + "places": "bworld:beetroots", + "base_sell_value": 25 + } +} diff --git a/mods/bworld/items/cotton.json b/mods/bworld/items/cotton.json new file mode 100644 index 0000000..424034a --- /dev/null +++ b/mods/bworld/items/cotton.json @@ -0,0 +1,8 @@ +{ + "format_version": 1, + "item": { + "id": "bworld:cotton", + "texture": "bworld:cotton", + "base_sell_value": 15 + } +} diff --git a/mods/bworld/items/cotton_seeds.json b/mods/bworld/items/cotton_seeds.json new file mode 100644 index 0000000..4b6770b --- /dev/null +++ b/mods/bworld/items/cotton_seeds.json @@ -0,0 +1,8 @@ +{ + "format_version": 1, + "item": { + "id": "bworld:cotton_seeds", + "texture": "bworld:cotton_seed", + "places": "bworld:cotton" + } +} diff --git a/mods/bworld/items/strawberry.json b/mods/bworld/items/strawberry.json new file mode 100644 index 0000000..2343414 --- /dev/null +++ b/mods/bworld/items/strawberry.json @@ -0,0 +1,12 @@ +{ + "format_version": 1, + "item": { + "id": "bworld:strawberry", + "texture": "bworld:strawberry", + "food": { + "nutrition": 2, + "saturation_modifier": 0.3 + }, + "base_sell_value": 30 + } +} diff --git a/mods/bworld/items/strawberry_seeds.json b/mods/bworld/items/strawberry_seeds.json new file mode 100644 index 0000000..249ecf3 --- /dev/null +++ b/mods/bworld/items/strawberry_seeds.json @@ -0,0 +1,8 @@ +{ + "format_version": 1, + "item": { + "id": "bworld:strawberry_seeds", + "texture": "bworld:strawberry_seed", + "places": "bworld:strawberries" + } +} diff --git a/mods/bworld/loot_tables/blocks/beetroots.json b/mods/bworld/loot_tables/blocks/beetroots.json new file mode 100644 index 0000000..41d0e66 --- /dev/null +++ b/mods/bworld/loot_tables/blocks/beetroots.json @@ -0,0 +1,39 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:beetroot" + } + ] + }, + { + "conditions": [ + { + "condition": "block_state", + "states": { + "age": 7 + } + } + ], + "entries": [ + { + "item": "bworld:beetroot", + "functions": [ + { + "function": "set_count", + "count": { + "n": 3, + "p": 0.5714 + }, + "add": true + } + ] + } + ] + } + ] + } +} diff --git a/mods/bworld/loot_tables/blocks/cotton.json b/mods/bworld/loot_tables/blocks/cotton.json new file mode 100644 index 0000000..7a3e6ea --- /dev/null +++ b/mods/bworld/loot_tables/blocks/cotton.json @@ -0,0 +1,61 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:cotton", + "conditions": [ + { + "condition": "block_state", + "states": { + "age": 7 + } + } + ] + }, + { + "item": "bworld:cotton_seeds", + "conditions": [ + { + "condition": "inverted", + "term": { + "condition": "block_state", + "states": { + "age": 7 + } + } + } + ] + } + ] + }, + { + "conditions": [ + { + "condition": "block_state", + "states": { + "age": 7 + } + } + ], + "entries": [ + { + "item": "bworld:cotton_seeds", + "functions": [ + { + "function": "set_count", + "count": { + "n": 3, + "p": 0.5714 + }, + "add": true + } + ] + } + ] + } + ] + } +} diff --git a/mods/bworld/loot_tables/blocks/strawberries.json b/mods/bworld/loot_tables/blocks/strawberries.json new file mode 100644 index 0000000..9b3e278 --- /dev/null +++ b/mods/bworld/loot_tables/blocks/strawberries.json @@ -0,0 +1,29 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:strawberry_seeds" + } + ] + }, + { + "conditions": [ + { + "condition": "block_state", + "states": { + "age": 5 + } + } + ], + "entries": [ + { + "item": "bworld:strawberry" + } + ] + } + ] + } +} diff --git a/mods/bworld/loot_tables/harvest/cotton.json b/mods/bworld/loot_tables/harvest/cotton.json new file mode 100644 index 0000000..bb73deb --- /dev/null +++ b/mods/bworld/loot_tables/harvest/cotton.json @@ -0,0 +1,18 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:cotton", + "count": { + "min": 1, + "max": 2 + } + } + ] + } + ] + } +} diff --git a/mods/bworld/loot_tables/harvest/strawberries.json b/mods/bworld/loot_tables/harvest/strawberries.json new file mode 100644 index 0000000..a40d8f4 --- /dev/null +++ b/mods/bworld/loot_tables/harvest/strawberries.json @@ -0,0 +1,18 @@ +{ + "format_version": 1, + "loot_table": { + "pools": [ + { + "entries": [ + { + "item": "bworld:strawberry", + "count": { + "min": 1, + "max": 3 + } + } + ] + } + ] + } +} diff --git a/mods/bworld/textures/beetroot.png b/mods/bworld/textures/beetroot.png new file mode 100644 index 0000000..472f5ad Binary files /dev/null and b/mods/bworld/textures/beetroot.png differ diff --git a/mods/bworld/textures/beetroot_stage_0.png b/mods/bworld/textures/beetroot_stage_0.png new file mode 100644 index 0000000..d1fccef Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_0.png differ diff --git a/mods/bworld/textures/beetroot_stage_1.png b/mods/bworld/textures/beetroot_stage_1.png new file mode 100644 index 0000000..9f2f965 Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_1.png differ diff --git a/mods/bworld/textures/beetroot_stage_2.png b/mods/bworld/textures/beetroot_stage_2.png new file mode 100644 index 0000000..1ed66b6 Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_2.png differ diff --git a/mods/bworld/textures/beetroot_stage_3.png b/mods/bworld/textures/beetroot_stage_3.png new file mode 100644 index 0000000..774ea40 Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_3.png differ diff --git a/mods/bworld/textures/beetroot_stage_4.png b/mods/bworld/textures/beetroot_stage_4.png new file mode 100644 index 0000000..4192e1b Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_4.png differ diff --git a/mods/bworld/textures/beetroot_stage_5.png b/mods/bworld/textures/beetroot_stage_5.png new file mode 100644 index 0000000..f9b7490 Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_5.png differ diff --git a/mods/bworld/textures/beetroot_stage_6.png b/mods/bworld/textures/beetroot_stage_6.png new file mode 100644 index 0000000..3c96722 Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_6.png differ diff --git a/mods/bworld/textures/beetroot_stage_7.png b/mods/bworld/textures/beetroot_stage_7.png new file mode 100644 index 0000000..9cdee33 Binary files /dev/null and b/mods/bworld/textures/beetroot_stage_7.png differ diff --git a/mods/bworld/textures/cotton.png b/mods/bworld/textures/cotton.png new file mode 100644 index 0000000..98e34ad Binary files /dev/null and b/mods/bworld/textures/cotton.png differ diff --git a/mods/bworld/textures/cotton_seed.png b/mods/bworld/textures/cotton_seed.png new file mode 100644 index 0000000..7dd6608 Binary files /dev/null and b/mods/bworld/textures/cotton_seed.png differ diff --git a/mods/bworld/textures/cotton_stage_0.png b/mods/bworld/textures/cotton_stage_0.png new file mode 100644 index 0000000..46740da Binary files /dev/null and b/mods/bworld/textures/cotton_stage_0.png differ diff --git a/mods/bworld/textures/cotton_stage_1.png b/mods/bworld/textures/cotton_stage_1.png new file mode 100644 index 0000000..8a561e2 Binary files /dev/null and b/mods/bworld/textures/cotton_stage_1.png differ diff --git a/mods/bworld/textures/cotton_stage_2.png b/mods/bworld/textures/cotton_stage_2.png new file mode 100644 index 0000000..7c47114 Binary files /dev/null and b/mods/bworld/textures/cotton_stage_2.png differ diff --git a/mods/bworld/textures/cotton_stage_3.png b/mods/bworld/textures/cotton_stage_3.png new file mode 100644 index 0000000..bc118ba Binary files /dev/null and b/mods/bworld/textures/cotton_stage_3.png differ diff --git a/mods/bworld/textures/cotton_stage_4.png b/mods/bworld/textures/cotton_stage_4.png new file mode 100644 index 0000000..e1c1d16 Binary files /dev/null and b/mods/bworld/textures/cotton_stage_4.png differ diff --git a/mods/bworld/textures/cotton_stage_5.png b/mods/bworld/textures/cotton_stage_5.png new file mode 100644 index 0000000..d039ab4 Binary files /dev/null and b/mods/bworld/textures/cotton_stage_5.png differ diff --git a/mods/bworld/textures/cotton_stage_6.png b/mods/bworld/textures/cotton_stage_6.png new file mode 100644 index 0000000..85cf084 Binary files /dev/null and b/mods/bworld/textures/cotton_stage_6.png differ diff --git a/mods/bworld/textures/cotton_stage_7.png b/mods/bworld/textures/cotton_stage_7.png new file mode 100644 index 0000000..56f9250 Binary files /dev/null and b/mods/bworld/textures/cotton_stage_7.png differ diff --git a/mods/bworld/textures/melon.png b/mods/bworld/textures/melon.png new file mode 100644 index 0000000..317b68f Binary files /dev/null and b/mods/bworld/textures/melon.png differ diff --git a/mods/bworld/textures/melon_bottom.png b/mods/bworld/textures/melon_bottom.png new file mode 100644 index 0000000..4972c59 Binary files /dev/null and b/mods/bworld/textures/melon_bottom.png differ diff --git a/mods/bworld/textures/melon_seed.png b/mods/bworld/textures/melon_seed.png new file mode 100644 index 0000000..6925bec Binary files /dev/null and b/mods/bworld/textures/melon_seed.png differ diff --git a/mods/bworld/textures/melon_side.png b/mods/bworld/textures/melon_side.png new file mode 100644 index 0000000..61080c2 Binary files /dev/null and b/mods/bworld/textures/melon_side.png differ diff --git a/mods/bworld/textures/melon_stage_0.png b/mods/bworld/textures/melon_stage_0.png new file mode 100644 index 0000000..532314e Binary files /dev/null and b/mods/bworld/textures/melon_stage_0.png differ diff --git a/mods/bworld/textures/melon_stage_1.png b/mods/bworld/textures/melon_stage_1.png new file mode 100644 index 0000000..e6836dd Binary files /dev/null and b/mods/bworld/textures/melon_stage_1.png differ diff --git a/mods/bworld/textures/melon_stage_2.png b/mods/bworld/textures/melon_stage_2.png new file mode 100644 index 0000000..4b4975d Binary files /dev/null and b/mods/bworld/textures/melon_stage_2.png differ diff --git a/mods/bworld/textures/melon_stage_3.png b/mods/bworld/textures/melon_stage_3.png new file mode 100644 index 0000000..076a34c Binary files /dev/null and b/mods/bworld/textures/melon_stage_3.png differ diff --git a/mods/bworld/textures/melon_stage_4.png b/mods/bworld/textures/melon_stage_4.png new file mode 100644 index 0000000..4ea1f9c Binary files /dev/null and b/mods/bworld/textures/melon_stage_4.png differ diff --git a/mods/bworld/textures/melon_stage_5.png b/mods/bworld/textures/melon_stage_5.png new file mode 100644 index 0000000..e0587d0 Binary files /dev/null and b/mods/bworld/textures/melon_stage_5.png differ diff --git a/mods/bworld/textures/melon_stage_6.png b/mods/bworld/textures/melon_stage_6.png new file mode 100644 index 0000000..97559d4 Binary files /dev/null and b/mods/bworld/textures/melon_stage_6.png differ diff --git a/mods/bworld/textures/melon_stage_7.png b/mods/bworld/textures/melon_stage_7.png new file mode 100644 index 0000000..6e65109 Binary files /dev/null and b/mods/bworld/textures/melon_stage_7.png differ diff --git a/mods/bworld/textures/melon_top.png b/mods/bworld/textures/melon_top.png new file mode 100644 index 0000000..f693773 Binary files /dev/null and b/mods/bworld/textures/melon_top.png differ diff --git a/mods/bworld/textures/pumpkin_bottom.png b/mods/bworld/textures/pumpkin_bottom.png new file mode 100644 index 0000000..907bee9 Binary files /dev/null and b/mods/bworld/textures/pumpkin_bottom.png differ diff --git a/mods/bworld/textures/pumpkin_side.png b/mods/bworld/textures/pumpkin_side.png new file mode 100644 index 0000000..03fcf48 Binary files /dev/null and b/mods/bworld/textures/pumpkin_side.png differ diff --git a/mods/bworld/textures/pumpkin_stage_0.png b/mods/bworld/textures/pumpkin_stage_0.png new file mode 100644 index 0000000..6d3d569 Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_0.png differ diff --git a/mods/bworld/textures/pumpkin_stage_1.png b/mods/bworld/textures/pumpkin_stage_1.png new file mode 100644 index 0000000..9c6573d Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_1.png differ diff --git a/mods/bworld/textures/pumpkin_stage_2.png b/mods/bworld/textures/pumpkin_stage_2.png new file mode 100644 index 0000000..7ec7771 Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_2.png differ diff --git a/mods/bworld/textures/pumpkin_stage_3.png b/mods/bworld/textures/pumpkin_stage_3.png new file mode 100644 index 0000000..fc91bab Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_3.png differ diff --git a/mods/bworld/textures/pumpkin_stage_4.png b/mods/bworld/textures/pumpkin_stage_4.png new file mode 100644 index 0000000..c1f5097 Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_4.png differ diff --git a/mods/bworld/textures/pumpkin_stage_5.png b/mods/bworld/textures/pumpkin_stage_5.png new file mode 100644 index 0000000..699cf46 Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_5.png differ diff --git a/mods/bworld/textures/pumpkin_stage_6.png b/mods/bworld/textures/pumpkin_stage_6.png new file mode 100644 index 0000000..f2fe8a2 Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_6.png differ diff --git a/mods/bworld/textures/pumpkin_stage_7.png b/mods/bworld/textures/pumpkin_stage_7.png new file mode 100644 index 0000000..e344193 Binary files /dev/null and b/mods/bworld/textures/pumpkin_stage_7.png differ diff --git a/mods/bworld/textures/pumpkin_top.png b/mods/bworld/textures/pumpkin_top.png new file mode 100644 index 0000000..70c8fab Binary files /dev/null and b/mods/bworld/textures/pumpkin_top.png differ diff --git a/mods/bworld/textures/strawberry.png b/mods/bworld/textures/strawberry.png new file mode 100644 index 0000000..6d4daf8 Binary files /dev/null and b/mods/bworld/textures/strawberry.png differ diff --git a/mods/bworld/textures/strawberry_seed.png b/mods/bworld/textures/strawberry_seed.png new file mode 100644 index 0000000..c6bdd20 Binary files /dev/null and b/mods/bworld/textures/strawberry_seed.png differ diff --git a/mods/bworld/textures/strawberry_stage_0.png b/mods/bworld/textures/strawberry_stage_0.png new file mode 100644 index 0000000..d0ae090 Binary files /dev/null and b/mods/bworld/textures/strawberry_stage_0.png differ diff --git a/mods/bworld/textures/strawberry_stage_1.png b/mods/bworld/textures/strawberry_stage_1.png new file mode 100644 index 0000000..f7e5ee9 Binary files /dev/null and b/mods/bworld/textures/strawberry_stage_1.png differ diff --git a/mods/bworld/textures/strawberry_stage_2.png b/mods/bworld/textures/strawberry_stage_2.png new file mode 100644 index 0000000..1ac51fb Binary files /dev/null and b/mods/bworld/textures/strawberry_stage_2.png differ diff --git a/mods/bworld/textures/strawberry_stage_3.png b/mods/bworld/textures/strawberry_stage_3.png new file mode 100644 index 0000000..d38c21f Binary files /dev/null and b/mods/bworld/textures/strawberry_stage_3.png differ diff --git a/mods/bworld/textures/strawberry_stage_4.png b/mods/bworld/textures/strawberry_stage_4.png new file mode 100644 index 0000000..bd69865 Binary files /dev/null and b/mods/bworld/textures/strawberry_stage_4.png differ diff --git a/mods/bworld/textures/strawberry_stage_5.png b/mods/bworld/textures/strawberry_stage_5.png new file mode 100644 index 0000000..7f62d22 Binary files /dev/null and b/mods/bworld/textures/strawberry_stage_5.png differ diff --git a/tests/farming_test.ts b/tests/farming_test.ts index 78b5736..5533cce 100644 --- a/tests/farming_test.ts +++ b/tests/farming_test.ts @@ -275,3 +275,34 @@ Deno.test("a two block crop dies whole, its top going without dropping anything" assertEquals(t.game.world.get_block_id(1, 101, 0), "bworld:air"); assertEquals(t.game.item_entities(), []); }); + +Deno.test("beetroots, cotton and strawberries grow, and strawberries and cotton are picked and grow back", async () => { + const t = await setup(); + // beetroots and strawberries grow in spring + assertEquals(grow(t, 0, "bworld:beetroots", 6), [1, 2, 3, 4, 5, 7]); + const strawberries = grow(t, 1, "bworld:strawberries", 8); + assertEquals(strawberries.at(-2), 4, "not grown a day early"); + assertEquals(strawberries.at(-1), 5); + + t.use(1, 101, 0); + const picked = t.game.item_entities().map((e) => e.item.to_data()); + assertEquals(picked.map((item) => item.id), ["bworld:strawberry"]); + assertEquals(t.state(1, 101, 0, "age"), 2, "back to a young bush"); + + // cotton grows in summer, which starts on day 50 + t.game.set_time(49 * CYCLE_TICKS); + t.game.tick(); + assertEquals(grow(t, 2, "bworld:cotton", 10), [0, 1, 2, 2, 3, 4, 4, 5, 6, 7]); + // picked like strawberries, it grows back in 3 days + t.use(2, 101, 0); + const cotton = t.game.item_entities().map((e) => e.item.to_data()).filter((item) => item.id === "bworld:cotton"); + assertEquals(cotton.length, 1); + assert(cotton[0].count >= 1 && cotton[0].count <= 2); + assertEquals(t.state(2, 101, 0, "age"), 4, "back to a young plant"); + assertEquals(t.game.world.get_block_id(2, 101, 0), "bworld:cotton", "the plant stays"); + for (let day = 0; day < 3; day++) { + t.game.set_block_state(2, 100, 0, 1); + t.next_morning(); + } + assertEquals(t.state(2, 101, 0, "age"), 7); +});