Skip to content

Claude/silk touch axe leaf drop xwfxuu - #5

Merged
awdrgyj8 merged 3 commits into
masterfrom
claude/silk-touch-axe-leaf-drop-xwfxuu
Aug 31, 2026
Merged

Claude/silk touch axe leaf drop xwfxuu#5
awdrgyj8 merged 3 commits into
masterfrom
claude/silk-touch-axe-leaf-drop-xwfxuu

Conversation

@awdrgyj8

Copy link
Copy Markdown
Member

No description provided.

claude added 3 commits August 31, 2026 13:55
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
@awdrgyj8
awdrgyj8 merged commit 8b2d079 into master Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants