Skip to content

Fix held-slot exclusion in stored items and allow console commands with explicit target - #64

Merged
osipxd merged 2 commits into
developfrom
fix/player-inventory-bugs
Nov 10, 2026
Merged

osipxd merged 2 commits into
developfrom
fix/player-inventory-bugs

Conversation

@osipxd

@osipxd osipxd commented Nov 10, 2026

Copy link
Copy Markdown
Member

Inventory

BukkitPlayerInventory.collectStoredItems removed the held item with minus(itemInMainHand), which drops the first equal stack rather than the held slot. With two equal stacks, the wrong instance was excluded. Now the held slot is filtered by heldItemSlot index. Added a regression test in MinecraftPlayerInventoryTest.

Commands

/mimic inventory info <player>, /mimic class info <player>, /mimic class check <player> <classes> and /mimic xp ... <player> were player-only even when a target is given. The target forms now use executesAny; forms without a target stay player-only. getPlayerOrDefault is replaced with getPlayerOrSender.

Not tested on a live server: console execution of these commands.

🤖 Generated with Claude Code

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

osipxd and others added 2 commits November 10, 2026 22:11
collectStoredItems removed the first stack equal to the held one,
which could be a stack from another slot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Class, xp and inventory commands rejected the console even when a
target player was specified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@osipxd
osipxd force-pushed the fix/player-inventory-bugs branch from c265cce to d291d6e Compare November 10, 2026 21:18
@osipxd
osipxd enabled auto-merge (rebase) November 10, 2026 21:18
@osipxd osipxd added this to the Next milestone Nov 10, 2026
@osipxd
osipxd merged commit 5b62f14 into develop Nov 10, 2026
3 checks passed
@osipxd
osipxd deleted the fix/player-inventory-bugs branch November 10, 2026 21:22
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.

1 participant