From 7de04b575ddfb379d938ca8db546ae76f527180a Mon Sep 17 00:00:00 2001 From: JunkyDeveloper Date: Sun, 11 Oct 2026 06:03:13 +0200 Subject: [PATCH] Add Flint tests for leaves (11 blocks) --- .../leaves/cherry_leaves_decay.json | 42 ++++++++++++ .../cherry_leaves_placement_and_distance.json | 56 ++++++++++++++++ .../mangrove_leaves_bonemeal_propagule.json | 66 +++++++++++++++++++ ...rove_leaves_hanging_propagule_support.json | 58 ++++++++++++++++ tests/vegetation/leaves/oak_leaves_decay.json | 46 +++++++++++++ .../leaves/oak_leaves_distance_adjacency.json | 54 +++++++++++++++ .../oak_leaves_distance_propagation.json | 58 ++++++++++++++++ .../leaves/oak_leaves_no_torch_support.json | 46 +++++++++++++ .../leaves/oak_leaves_piston_destroy.json | 37 +++++++++++ .../leaves/oak_leaves_placement.json | 63 ++++++++++++++++++ .../leaves/oak_leaves_rejects_bonemeal.json | 38 +++++++++++ .../oak_leaves_waterlogged_no_flow.json | 46 +++++++++++++ 12 files changed, 610 insertions(+) create mode 100644 tests/vegetation/leaves/cherry_leaves_decay.json create mode 100644 tests/vegetation/leaves/cherry_leaves_placement_and_distance.json create mode 100644 tests/vegetation/leaves/mangrove_leaves_bonemeal_propagule.json create mode 100644 tests/vegetation/leaves/mangrove_leaves_hanging_propagule_support.json create mode 100644 tests/vegetation/leaves/oak_leaves_decay.json create mode 100644 tests/vegetation/leaves/oak_leaves_distance_adjacency.json create mode 100644 tests/vegetation/leaves/oak_leaves_distance_propagation.json create mode 100644 tests/vegetation/leaves/oak_leaves_no_torch_support.json create mode 100644 tests/vegetation/leaves/oak_leaves_piston_destroy.json create mode 100644 tests/vegetation/leaves/oak_leaves_placement.json create mode 100644 tests/vegetation/leaves/oak_leaves_rejects_bonemeal.json create mode 100644 tests/vegetation/leaves/oak_leaves_waterlogged_no_flow.json diff --git a/tests/vegetation/leaves/cherry_leaves_decay.json b/tests/vegetation/leaves/cherry_leaves_decay.json new file mode 100644 index 0000000..523b104 --- /dev/null +++ b/tests/vegetation/leaves/cherry_leaves_decay.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "cherry_leaves_decay", + "description": "With a high random tick speed, non-persistent cherry leaves at distance 7 decay to air, while persistent cherry leaves stay.", + "tags": ["vegetation", "leaves", "cherry", "decay", "random-tick", "block-state"], + "minecraftIds": ["minecraft:cherry_leaves"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [3, 3, 1] ] + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 4096 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 1, 0], "block": {"id": "minecraft:cherry_leaves", "distance": 7, "persistent": false} }, + { "pos": [2, 1, 0], "block": {"id": "minecraft:cherry_leaves", "distance": 7, "persistent": true } } + ] + }, + { + "at": 60, + "do": "assert", + "checks": [ + { "pos": [0, 1, 0], "is": {"id": "minecraft:air" } }, + { "pos": [2, 1, 0], "is": {"id": "minecraft:cherry_leaves", "distance": 7, "persistent": true} } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/cherry_leaves_placement_and_distance.json b/tests/vegetation/leaves/cherry_leaves_placement_and_distance.json new file mode 100644 index 0000000..6849907 --- /dev/null +++ b/tests/vegetation/leaves/cherry_leaves_placement_and_distance.json @@ -0,0 +1,56 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "cherry_leaves_placement_and_distance", + "description": "Cherry leaves (untinted-particle implementation) behave like other leaves on the server: survival placement is persistent with distance 7, and non-persistent leaves get their distance from an adjacent log.", + "tags": ["vegetation", "leaves", "cherry", "placement", "distance", "block-state", "player"], + "minecraftIds": ["minecraft:cherry_leaves", "minecraft:oak_log", "minecraft:stone"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [6, 3, 1] ] + }, + "player": { + "inventory": { "hotbar1": {"id": "minecraft:cherry_leaves", "count": 1} }, + "selected_hotbar": 1, + "game_mode": "Survival" + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 0 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 0, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [4, 1, 0], "block": {"id": "minecraft:cherry_leaves", "distance": 7, "persistent": false} }, + { "pos": [5, 1, 0], "block": {"id": "minecraft:cherry_leaves", "distance": 7, "persistent": false} } + ] + }, + { "at": 1, "do": "tp", "entity_alias": "player", "pos": [0.5, 3, 0.5], "rot": [0, 90] }, + {"at": 1, "do": "interact"}, + { "at": 3, "do": "place", "pos": [3, 1, 0], "block": {"id": "minecraft:oak_log", "axis": "y"} }, + { + "at": 12, + "do": "assert", + "checks": [ + { + "pos": [0, 1, 0], + "is": {"id": "minecraft:cherry_leaves", "distance": 7, "persistent": true, "waterlogged": false} + }, + { "pos": [4, 1, 0], "is": {"id": "minecraft:cherry_leaves", "distance": 1, "persistent": false} }, + { "pos": [5, 1, 0], "is": {"id": "minecraft:cherry_leaves", "distance": 2, "persistent": false} }, + {"is": "empty", "slot": "hotbar1"} + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/mangrove_leaves_bonemeal_propagule.json b/tests/vegetation/leaves/mangrove_leaves_bonemeal_propagule.json new file mode 100644 index 0000000..b9ca7ee --- /dev/null +++ b/tests/vegetation/leaves/mangrove_leaves_bonemeal_propagule.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "mangrove_leaves_bonemeal_propagule", + "description": "Bone meal on mangrove leaves with air below grows a hanging propagule (age 0) there and is consumed; with a solid block below it does nothing and is not consumed.", + "tags": ["vegetation", "leaves", "mangrove", "propagule", "bone-meal", "player"], + "minecraftIds": [ + "minecraft:mangrove_leaves" , "minecraft:mangrove_propagule", "minecraft:bone_meal" , + "minecraft:stone" + ], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [5, 3, 1] ] + }, + "player": { + "inventory": { "hotbar1": {"id": "minecraft:bone_meal", "count": 2} }, + "selected_hotbar": 1, + "game_mode": "Survival" + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 0 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 1, 0], "block": {"id": "minecraft:mangrove_leaves", "persistent": true} }, + { "pos": [4, 1, 0], "block": {"id": "minecraft:mangrove_leaves", "persistent": true} }, + { "pos": [4, 0, 0], "block": {"id": "minecraft:stone" } } + ] + }, + { "at": 1, "do": "tp", "entity_alias": "player", "pos": [0.5, 3, 0.5], "rot": [0, 90] }, + {"at": 1, "do": "interact"}, + { + "at": 3, + "do": "assert", + "checks": [ + { "pos": [0, 0, 0], "is": {"id": "minecraft:mangrove_propagule", "hanging": true, "age": 0} }, + { "pos": [0, 1, 0], "is": {"id": "minecraft:mangrove_leaves", "persistent": true} } , + { "is": {"id": "minecraft:bone_meal", "count": 1}, "slot": "hotbar1" } + ] + }, + { "at": 4, "do": "tp", "entity_alias": "player", "pos": [4.5, 3, 0.5], "rot": [0, 90] }, + {"at": 4, "do": "interact"}, + { + "at": 6, + "do": "assert", + "checks": [ + { "pos": [4, 0, 0], "is": {"id": "minecraft:stone"} } , + { "pos": [4, 1, 0], "is": {"id": "minecraft:mangrove_leaves", "persistent": true} } , + { "pos": [0, 0, 0], "is": {"id": "minecraft:mangrove_propagule", "hanging": true, "age": 0} }, + { "is": {"id": "minecraft:bone_meal", "count": 1}, "slot": "hotbar1" } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/mangrove_leaves_hanging_propagule_support.json b/tests/vegetation/leaves/mangrove_leaves_hanging_propagule_support.json new file mode 100644 index 0000000..0407736 --- /dev/null +++ b/tests/vegetation/leaves/mangrove_leaves_hanging_propagule_support.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "mangrove_leaves_hanging_propagule_support", + "description": "A hanging propagule stays under mangrove leaves, but breaks when the mangrove leaves are removed or replaced with oak leaves, since only mangrove leaves support hanging propagules.", + "tags": ["vegetation", "leaves", "mangrove", "propagule", "support", "neighbor-update"], + "minecraftIds": ["minecraft:mangrove_leaves", "minecraft:mangrove_propagule", "minecraft:oak_leaves"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [5, 2, 1] ] + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 0 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 1, 0], "block": {"id": "minecraft:mangrove_leaves", "persistent": true} }, + { "pos": [2, 1, 0], "block": {"id": "minecraft:mangrove_leaves", "persistent": true} }, + { "pos": [4, 1, 0], "block": {"id": "minecraft:mangrove_leaves", "persistent": true} }, + { "pos": [0, 0, 0], "block": {"id": "minecraft:mangrove_propagule", "hanging": true, "age": 0} }, + { "pos": [2, 0, 0], "block": {"id": "minecraft:mangrove_propagule", "hanging": true, "age": 0} }, + { "pos": [4, 0, 0], "block": {"id": "minecraft:mangrove_propagule", "hanging": true, "age": 0} } + ] + }, + { + "at": 3, + "do": "assert", + "checks": [ + { "pos": [0, 0, 0], "is": {"id": "minecraft:mangrove_propagule", "hanging": true} }, + { "pos": [2, 0, 0], "is": {"id": "minecraft:mangrove_propagule", "hanging": true} }, + { "pos": [4, 0, 0], "is": {"id": "minecraft:mangrove_propagule", "hanging": true} } + ] + }, + { "at": 4, "do": "remove", "pos": [2, 1, 0] }, + { "at": 4, "do": "place", "pos": [4, 1, 0], "block": {"id": "minecraft:oak_leaves", "persistent": true} }, + { + "at": 7, + "do": "assert", + "checks": [ + { "pos": [0, 0, 0], "is": {"id": "minecraft:mangrove_propagule", "hanging": true, "age": 0} }, + { "pos": [2, 0, 0], "is": {"id": "minecraft:air" } }, + { "pos": [4, 0, 0], "is": {"id": "minecraft:air" } } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_decay.json b/tests/vegetation/leaves/oak_leaves_decay.json new file mode 100644 index 0000000..8d410d5 --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_decay.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_decay", + "description": "With a high random tick speed, non-persistent oak leaves at distance 7 decay to air, while persistent leaves and leaves within reach of a log stay.", + "tags": ["vegetation", "leaves", "decay", "random-tick", "block-state"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:oak_log"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [5, 3, 1] ] + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 4096 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 1, 0], "block": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} }, + { "pos": [2, 1, 0], "block": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": true} }, + { "pos": [4, 1, 0], "block": {"id": "minecraft:oak_leaves", "distance": 1, "persistent": false} }, + { "pos": [5, 1, 0], "block": {"id": "minecraft:oak_log", "axis": "y"} } + ] + }, + { + "at": 60, + "do": "assert", + "checks": [ + { "pos": [0, 1, 0], "is": {"id": "minecraft:air" } }, + { "pos": [2, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": true } }, + { "pos": [4, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 1, "persistent": false} }, + { "pos": [5, 1, 0], "is": {"id": "minecraft:oak_log" } } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_distance_adjacency.json b/tests/vegetation/leaves/oak_leaves_distance_adjacency.json new file mode 100644 index 0000000..eeb009c --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_distance_adjacency.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_distance_adjacency", + "description": "Leaf distance only follows face adjacency: a diagonal leaf and a leaf behind a stone block stay at 7, while a leaf next to a crimson stem gets distance 1.", + "tags": ["vegetation", "leaves", "distance", "block-state", "neighbor-update"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:oak_log", "minecraft:crimson_stem", "minecraft:stone"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [10, 3, 2] ] + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 0 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [1, 2, 1], "block": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} }, + { "pos": [6, 1, 0], "block": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} }, + { "pos": [9, 1, 0], "block": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} }, + { "pos": [5, 1, 0], "block": {"id": "minecraft:stone" } } + ] + }, + { + "at": 3, + "do": "place_each", + "blocks": [ + { "pos": [0, 1, 0], "block": {"id": "minecraft:oak_log" , "axis": "y"} }, + { "pos": [4, 1, 0], "block": {"id": "minecraft:oak_log" , "axis": "y"} }, + { "pos": [8, 1, 0], "block": {"id": "minecraft:crimson_stem", "axis": "y"} } + ] + }, + { + "at": 10, + "do": "assert", + "checks": [ + { "pos": [1, 2, 1], "is": {"id": "minecraft:oak_leaves", "distance": 7} }, + { "pos": [6, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7} }, + { "pos": [9, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 1} } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_distance_propagation.json b/tests/vegetation/leaves/oak_leaves_distance_propagation.json new file mode 100644 index 0000000..2d532a0 --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_distance_propagation.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_distance_propagation", + "description": "A log placed at the end of a row of non-persistent oak leaves gives them distance 1 through 7 along the row, and removing the log resets them all to 7.", + "tags": ["vegetation", "leaves", "distance", "block-state", "neighbor-update"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:oak_log"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [9, 2, 1] ] + }, + "world": { + "gamerules": { + "minecraft:spawn_mobs": false, + "minecraft:advance_time": false, + "minecraft:advance_weather": false, + "minecraft:random_tick_speed": 0 + } + } + }, + "timeline": [ + { + "at": 0, + "do": "fill", + "region": [ [1, 1, 0], [8, 1, 0] ], + "with": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} + }, + { "at": 3, "do": "place", "pos": [0, 1, 0], "block": {"id": "minecraft:oak_log", "axis": "y"} }, + { + "at": 20, + "do": "assert", + "checks": [ + { "pos": [1, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 1, "persistent": false} }, + { "pos": [2, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 2, "persistent": false} }, + { "pos": [3, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 3, "persistent": false} }, + { "pos": [4, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 4, "persistent": false} }, + { "pos": [5, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 5, "persistent": false} }, + { "pos": [6, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 6, "persistent": false} }, + { "pos": [7, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} }, + { "pos": [8, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": false} } + ] + }, + { "at": 21, "do": "remove", "pos": [0, 1, 0] }, + { + "at": 40, + "do": "assert", + "checks": [ + { "pos": [1, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7} }, + { "pos": [2, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7} }, + { "pos": [4, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7} }, + { "pos": [7, 1, 0], "is": {"id": "minecraft:oak_leaves", "distance": 7} } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_no_torch_support.json b/tests/vegetation/leaves/oak_leaves_no_torch_support.json new file mode 100644 index 0000000..7864b30 --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_no_torch_support.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_no_torch_support", + "description": "A torch cannot be placed on top of oak leaves because leaves have no support shape, so it is not placed or consumed, while the same torch stays placeable on stone.", + "tags": ["vegetation", "leaves", "support", "torch", "placement", "player"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:torch", "minecraft:stone"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [4, 3, 1] ] + }, + "player": { + "inventory": { "hotbar1": {"id": "minecraft:torch", "count": 2} }, + "selected_hotbar": 1, + "game_mode": "Survival" + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 0, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [0, 1, 0], "block": {"id": "minecraft:oak_leaves", "persistent": true} }, + { "pos": [3, 0, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [3, 1, 0], "block": {"id": "minecraft:stone" } } + ] + }, + { "at": 1, "do": "tp", "entity_alias": "player", "pos": [0.5, 4, 0.5], "rot": [0, 90] }, + {"at": 1, "do": "interact"}, + { "at": 2, "do": "tp", "entity_alias": "player", "pos": [3.5, 4, 0.5], "rot": [0, 90] }, + {"at": 2, "do": "interact"}, + { + "at": 4, + "do": "assert", + "checks": [ + { "pos": [0, 2, 0], "is": {"id": "minecraft:air" } }, + { "pos": [3, 2, 0], "is": {"id": "minecraft:torch" } }, + { "is": {"id": "minecraft:torch", "count": 1}, "slot": "hotbar1" } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_piston_destroy.json b/tests/vegetation/leaves/oak_leaves_piston_destroy.json new file mode 100644 index 0000000..56191da --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_piston_destroy.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_piston_destroy", + "description": "A piston extending into oak leaves destroys them instead of pushing them, and the piston head takes their place.", + "tags": ["vegetation", "leaves", "piston", "push-reaction", "redstone"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:piston", "minecraft:redstone_block"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [3, 2, 2] ] + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 1, 0], "block": {"id": "minecraft:piston", "facing": "east", "extended": false} }, + { "pos": [1, 1, 0], "block": {"id": "minecraft:oak_leaves", "persistent": true} }, + { "pos": [2, 1, 0], "block": {"id": "minecraft:oak_leaves", "persistent": true} } + ] + }, + { "at": 2, "do": "place", "pos": [0, 1, 1], "block": {"id": "minecraft:redstone_block"} }, + { + "at": 10, + "do": "assert", + "checks": [ + { "pos": [0, 1, 0], "is": {"id": "minecraft:piston" , "facing": "east", "extended": true} }, + { "pos": [1, 1, 0], "is": {"id": "minecraft:piston_head", "facing": "east" } }, + { "pos": [2, 1, 0], "is": {"id": "minecraft:oak_leaves" } } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_placement.json b/tests/vegetation/leaves/oak_leaves_placement.json new file mode 100644 index 0000000..841b177 --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_placement.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_placement", + "description": "Survival-placed oak leaves are persistent; distance is 7 away from logs, 1 next to a log, and placing into a water source waterlogs them. All three items are consumed.", + "tags": ["vegetation", "leaves", "placement", "block-state", "waterlogged", "player"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:oak_log", "minecraft:stone", "minecraft:water"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [9, 3, 1] ] + }, + "player": { + "inventory": { "hotbar1": {"id": "minecraft:oak_leaves", "count": 3} }, + "selected_hotbar": 1, + "game_mode": "Survival" + } + }, + "timeline": [ + { + "at": 0, + "do": "place_each", + "blocks": [ + { "pos": [0, 0, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [4, 0, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [5, 1, 0], "block": {"id": "minecraft:oak_log", "axis": "y"} }, + { "pos": [8, 0, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [7, 1, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [9, 1, 0], "block": {"id": "minecraft:stone" } }, + { "pos": [8, 1, -1], "block": {"id": "minecraft:stone" } }, + { "pos": [8, 1, 1], "block": {"id": "minecraft:stone" } }, + { "pos": [8, 1, 0], "block": {"id": "minecraft:water" } } + ] + }, + { "at": 1, "do": "tp", "entity_alias": "player", "pos": [0.5, 3, 0.5], "rot": [0, 90] }, + {"at": 1, "do": "interact"}, + { "at": 2, "do": "tp", "entity_alias": "player", "pos": [4.5, 3, 0.5], "rot": [0, 90] }, + {"at": 2, "do": "interact"}, + { "at": 3, "do": "tp", "entity_alias": "player", "pos": [8.5, 3, 0.5], "rot": [0, 90] }, + {"at": 3, "do": "interact"}, + { + "at": 4, + "do": "assert", + "checks": [ + { + "pos": [0, 1, 0], + "is": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": true, "waterlogged": false} + }, + { + "pos": [4, 1, 0], + "is": {"id": "minecraft:oak_leaves", "distance": 1, "persistent": true, "waterlogged": false} + }, + { + "pos": [8, 1, 0], + "is": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": true, "waterlogged": true} + }, + {"is": "empty", "slot": "hotbar1"} + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_rejects_bonemeal.json b/tests/vegetation/leaves/oak_leaves_rejects_bonemeal.json new file mode 100644 index 0000000..8c236a2 --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_rejects_bonemeal.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_rejects_bonemeal", + "description": "Bone meal used on oak leaves has no effect and is not consumed.", + "tags": ["vegetation", "leaves", "bone-meal", "player"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:bone_meal"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-1, 0, -1], [1, 3, 1] ] + }, + "player": { + "inventory": { "hotbar1": {"id": "minecraft:bone_meal", "count": 1} }, + "selected_hotbar": 1, + "game_mode": "Survival" + } + }, + "timeline": [ + { "at": 0, "do": "place", "pos": [0, 1, 0], "block": {"id": "minecraft:oak_leaves", "persistent": true} }, + { "at": 1, "do": "tp", "entity_alias": "player", "pos": [0.5, 3, 0.5], "rot": [0, 90] }, + {"at": 1, "do": "interact"}, + { + "at": 3, + "do": "assert", + "checks": [ + { + "pos": [0, 1, 0], + "is": {"id": "minecraft:oak_leaves", "distance": 7, "persistent": true, "waterlogged": false} + }, + { "pos": [0, 0, 0], "is": {"id": "minecraft:air"} }, + { "is": {"id": "minecraft:bone_meal", "count": 1}, "slot": "hotbar1" } + ] + } + ], + "breakpoints": [] +} + diff --git a/tests/vegetation/leaves/oak_leaves_waterlogged_no_flow.json b/tests/vegetation/leaves/oak_leaves_waterlogged_no_flow.json new file mode 100644 index 0000000..7dfd08b --- /dev/null +++ b/tests/vegetation/leaves/oak_leaves_waterlogged_no_flow.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://raw.githubusercontent.com/FlintTestMC/flint-core/refs/heads/main/flint-content/test_spec_schema.json", + "flintVersion": "1.0.0", + "name": "oak_leaves_waterlogged_no_flow", + "description": "Waterlogged oak leaves keep their water inside: their full-cube collision shape stops the water from spreading into an adjacent air corridor, even after a neighbor update schedules a fluid tick.", + "tags": ["vegetation", "leaves", "waterlogged", "fluid", "neighbor-update"], + "minecraftIds": ["minecraft:oak_leaves", "minecraft:water", "minecraft:stone"], + "dependencies": [], + "setup": { + "cleanup": { + "region": [ [-2, 0, -1], [3, 2, 1] ] + } + }, + "timeline": [ + { + "at": 0, + "do": "fill", + "region": [ [-2, 0, -1], [3, 2, 1] ], + "with": {"id": "minecraft:stone"} + }, + { + "at": 1, + "do": "fill", + "region": [ [1, 1, 0], [2, 1, 0] ], + "with": {"id": "minecraft:air"} + }, + { + "at": 2, + "do": "place", + "pos": [0, 1, 0], + "block": {"id": "minecraft:oak_leaves", "persistent": true, "waterlogged": true} + }, + { "at": 4, "do": "place", "pos": [-1, 1, 0], "block": {"id": "minecraft:oak_planks"} }, + { + "at": 30, + "do": "assert", + "checks": [ + { "pos": [0, 1, 0], "is": {"id": "minecraft:oak_leaves", "waterlogged": true} }, + { "pos": [1, 1, 0], "is": {"id": "minecraft:air" } }, + { "pos": [2, 1, 0], "is": {"id": "minecraft:air" } } + ] + } + ], + "breakpoints": [] +} +