Repository navigation
Conversation
Remove the legacy overlays, raise min_format to 101 and update the incompatibility warning. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
timber:help now opens a dialog, which is also added to the pause screen. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The dialog is filled with the current scores on every open and writes them back on Done. Chop Slowly / Drop Loot exclusivity and the Stop Chopping -> Wear Out dependency are enforced, and the slow chop and auto plant loops are started when enabled. Closes #17 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaced by the dialogs. toggle/timber stays for /trigger TimberToggle. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Overlay formats is deprecated since pack format 82 and makes the pack fail to load. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The toggle button runs /trigger TimberToggle, which every player can use. The settings button now hints that operator permissions are required. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The checkbox dialog needed `function timber:settings/set`, which shows a confirmation screen for every click. Dialog buttons now only run `/trigger`, and the datapack reacts to it. Settings menu - Every setting is a button "Name: ON/OFF" with its description as a tooltip. Settings which depend on another one show "Locked" and the reason as a tooltip (Chop Slowly / Loot to Inventory, Stop on Axe Break / Wear Out Tool More). - The menu is built by functions on every open, so it always shows the current values. ON/OFF, Locked and the "Name: value" format use Minecraft's own translations. - The four number settings get their own slider dialog. The value is sent as `1<value>` in a single trigger. - Tools (the axes) is a sub page, everything else is on the main page. Long names are shortened, the full text stays in the tooltip. Triggers - `TimberToggle` stays enabled for everybody. Values above 1 are used by the help dialog (open settings, toggle, close). - `TimberSettings` and the slider triggers are only enabled while the menu is used and disabled again on leaving it or after 5 minutes without a click. - Only players with the tag `timber_admin` can change settings; everybody else gets a message with a clickable `/tag @s add timber_admin`. Help dialog - Buttons: check for updates, settings, toggle Timber for me. - The dialog opened from the pause screen is static and shows a neutral toggle label; the dynamic version shows Timber ON/OFF for the player. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add tests datapack with a test that mines the bottom log of an oak tree with a fake player and expects the whole tree to be chopped - Add test workflow for pull requests and pushes to main, run on Minecraft 26.1.2 and 26.3, with a "Test result" job to require in the branch ruleset - Add weekly latest workflow that tests newer Minecraft releases and opens an issue with the result - Add script to set up the Fabric server, Fabric API and PackTest Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The oak test now generates a vanilla tree with place feature and checks the whole area instead of single blocks. Shared setup lives in helper functions under timber_test:. Leaves left with distance=7 only warn: the test logs a TIMBER-WARNING line and the workflow shows it as a GitHub warning. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Tests run in parallel next to each other. Each one now uses the 20x24x20 timber_test:arena template and its own tagged dummy player. Adds a birch test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Tests wait until the base log is gone, give the datapack two ticks to react and then wait until no marker is left in the arena. await does not work inside a called function, so the three lines are repeated in each test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Every test generates the tree with place feature in a 40x40x40 arena, lets the dummy mine the base log and checks that no log or leaf is left. The base check only looks at the base log, acacia and azalea trunks lean away early. Checks run in two slabs because a command may only touch 32768 blocks. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n gaps The tall mangrove leans, its trunk does not start above the place where it is generated. The tests now search the whole arena for the lowest log and put the dummy next to it (the datapack only looks 7 blocks around the player). Tree generation retries because place feature sometimes fails for tall mangroves. Trees with fewer than min_leaves_found leaves next to a trunk must not be chopped and give a warning. A chop that starts at a mangrove log can leave parts standing (chop_down is off), that only warns too. Scores that were read after an await are now per test, parallel tests overwrote each other. Adds a debug mode (#debug) that leaves the arena untouched to look at it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Six tests: crimson and warped fungus (grown and planted variant) and the huge red and brown mushroom. chop_fungi is off by default, so the tests switch it on; it is global and the tests run in parallel, so its users are counted and it is switched back when the last one is done. Nether fungi need nylium under them, place feature fails silently otherwise. With chop_fungi on, every chop ends with a kill of all marker items of mushroom stems in the world, a chop in the same tick can delete the marker of another mushroom. The mushroom tests therefore run later and one after the other. Stems have to be gone, cap blocks that are left only warn. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A hut and a stack of logs without leaves, and a column with 4 leaves next to it are not chopped, the same column with 5 leaves is (min_leaves_found is 5), the same setup with one leaf more or less shows the rule holds at its edge. Five leaves placed by a player (persistent) next to a stack of logs are chopped anyway: the README says only natural leaves count, the leaf predicate does not check that and the persistent setting is not read anywhere. That is a known gap, the test warns instead of failing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Since v5.1.6 (a93c4dd, mangrove propagules) the leaf predicate accepted every leaf block. The check that the setting "persistent" switched on in v2.1.0 was lost with it: a leaf counts if it is natural (persistent=false), or if it is any leaf and the player has the setting on (timber_prsistent, set in run). Leaves placed by a player next to logs made a hut or a log stack a tree. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PackTest's assert score does not take a comparison of two scores, and the parse error inside a macro function is swallowed: assert_only_mined_gone and assert_not_chopped could never fail, so every test using them was green. They subtract and compare with matches now. Checked with a chopped column (fails) and the same column with 4 leaves (passes). placed_leaves_should_not_count is a hard test now: it fails without the fix of the leaf predicate and passes with it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Global settings can't be changed by tests that run in parallel. PackTest runs the tests of different environments as batches one after the other, so every setting gets an environment whose setup sets it and whose teardown puts the default back. 28 tests: sneaking, all seven axes on and off, chop_down, wear_out, hunger, destroy_leaves, chop_trees, max_tree_size, persistent, and min_leaves_found 13 and 14 (an oak has exactly 13 leaves next to its trunk). max_tree_size caps the chop, it doesn't refuse the tree (matches the menu text). A dummy can't duck under a block: sneaking tests use a column with leaves from height 3 on, a random oak has leaves above the dummy in one of three cases. The tests raise max_command_forks: dozens of chops in the same tick got to the limit, one in about 10 suite runs left leaves standing, 0 in 30 with it. The adjacency count includes hanging mangrove propagules like the leaf predicate. Chops that start at a mangrove root only warn about leftovers now, like the ones that start at a log. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
chop_fungi is a global setting. The fungus tests get a test environment that switches it on and back off, that replaces the counting of its users and the long delay. Two default tests show that a fungus is not chopped while chop_fungi is off (the default). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Three tests in their own environments: the tree goes block by block (still going after 10 ticks, all gone in the end), time_between_chops 10 makes it slower, blocks_per_chop 20 makes the whole tree go in 12 ticks. The loop that does the work is started by the setup of the environment. Checked against the same tests without slow chop and at the default speed: they fail there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A column of mangrove logs with roots on three sides and natural leaves, so the result doesn't depend on the random shape of a generated mangrove. Roots are removed by default and stay with destroy_roots off, mining a root chops the tree by default and doesn't with start_chop_on_root off. Both off tests fail without their environment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…r groups plant_sapling on plants a sapling item, off doesn't (the loop schedules itself, the teardown clears the scheduled round so it can't plant in the next batch). drop_loot on puts the logs of a chop into the inventory, a dummy picks nothing up so the block it mined itself stays on the ground. stop_chopping on stops the chop when the axe is nearly worn out, off chops the whole tree anyway. The "on" tests fail without their environment. The tests of the default environment are spread over five empty environments, they run as batches one after the other, that halves the ticks with dozens of chops. Big crowns (2x2 trunks, cherry, fancy oak) sometimes keep a few leaves, their logs have to be gone, leftover leaves only warn. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.