Claude/silk touch axe leaf drop xwfxuu - #5
Merged
Conversation
removeLeafBlock() and the log batch both take the player's tool, but only the auto pickup branch used it: the other branch called breakNaturally() with no argument, which rolls drops as if the block had been broken with nothing in hand. The result was that auto pickup, a setting about where drops end up, silently decided what they are. With leaf-removal-drop-items enabled, a player with auto pickup on got leaf blocks from a Silk Touch axe and extra saplings from Fortune, while a player with it off got neither from the exact same axe. Route both branches through DropCollectionUtils.breakNaturally(), which mirrors the null/AIR tool handling collectDrops() already does, so the two paths cannot drift apart again. The log branch has no visible change today (logs drop themselves regardless of enchantments) but had the same defect. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xsw1ZoP2KD2x9oEBVXJuwu
…rop-items leaf-removal-drop-items is an all-or-nothing switch: leaving it off (the default) means leaves vanish even for a Silk Touch axe, and turning it on showers every player with saplings, sticks and apples. Servers that want the vanilla Silk Touch behaviour had to accept the litter as well. Add leaf-removal-silk-touch-drops (default true), checked alongside the existing flag when deciding whether a leaf yields anything. Once either says yes, the drops themselves are already correct: both the auto pickup and the ground-drop path read the tool, so Silk Touch produces the leaf block and an unenchanted axe the usual sapling roll. The enchantment is resolved once per chop next to the auto pickup lookup, not per leaf, since the tool cannot change while a removal is running. Shears are deliberately not recognised: chain chopping starts from a log break, so shears never reach this path in practice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xsw1ZoP2KD2x9oEBVXJuwu
removeLeafBlock() read leafBlock.getType() after removing the block, so every leaf resolved to AIR: with increment-block-statistics enabled the player's stats file accumulated minecraft:mined -> minecraft:air, the real per-leaf statistics stayed at zero, and because Material was the map key all leaf types collapsed into that one bogus entry. Capture the type before the break, matching how originalLogType is already handled on the log side. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xsw1ZoP2KD2x9oEBVXJuwu
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.