Skip to content

feat: /island donate inv — donate everything from inventory#422

Merged
tastybento merged 3 commits intodevelopfrom
feat/donate-inv-command
May 4, 2026
Merged

feat: /island donate inv — donate everything from inventory#422
tastybento merged 3 commits intodevelopfrom
feat/donate-inv-command

Conversation

@tastybento
Copy link
Copy Markdown
Member

@tastybento tastybento commented May 4, 2026

Summary

  • Adds confirmable /island donate inv subcommand: lists every donatable block in the player's inventory with per-material values and a total, then on confirm donates them all and runs a level recalc. Items with no value or non-blocks stay in the inventory.
  • Adjusts help text: parameters: "[hand [amount]] [inv]" to show [inv] as an optional alternative.
  • Fixes donate tab-complete — BentoBox passes the leaf command label at args.get(0), so the prior args.size() <= 1 branch never fired in real use and only auto help showed. Tab-complete now suggests hand / inv for the first user-arg slot and the held-item count after hand. Tests now exercise the realistic args shape (["donate", ""]).
  • Bumps build version 2.26.0 → 2.27.0.

Test plan

  • mvn test (47 tests, all green)
  • mvn package produces Level-2.27.0-SNAPSHOT-LOCAL.jar
  • In-game: /is donate <TAB> shows hand, inv, help
  • In-game: /is donate inv shows the per-material breakdown + total, then on re-issue donates and recalculates the level
  • In-game: items with zero/no configured value stay in the inventory after inv donation
  • In-game: /is donate hand <TAB> still suggests the held count

🤖 Generated with Claude Code

tastybento and others added 3 commits May 3, 2026 22:10
Adds a confirmable "inv" subcommand that scans the player's inventory
for donatable blocks, lists each material with its point value plus a
total in the confirmation prompt, and on confirm donates all of them
in one go. Items with no value or that are not donatable blocks remain
in the inventory.

Also fixes the donate tab-complete: the args list BentoBox passes to a
subcommand includes the leaf label at index 0, so the previous
size-1 check never fired in real use and only the auto "help"
suggestion appeared. Tests now exercise the realistic args shape.

Bumps build version to 2.27.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the four new island.donate.inv keys (keyword, confirm-header,
confirm-line, confirm-total) to every non-English locale file. MiniMessage
tags and placeholders are preserved verbatim; only the human-readable
text was translated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses SonarCloud findings about duplicated string literals in
IslandDonateCommand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tastybento tastybento merged commit 1c81088 into develop May 4, 2026
1 check passed
@tastybento tastybento deleted the feat/donate-inv-command branch May 4, 2026 15:19
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 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.

1 participant