Repository navigation
feat: add /deco give to credit a bank or pouch - #29
Conversation
Console and operators can now pay a player with /deco give <player> <amount> [bank|pouch]. The bank is the default. Payments go through OfflineModifier, so online players are credited in their live session and offline players in their saved account file. Amounts must be positive whole cents. Each payment is logged, and an online recipient is told about it. The new denareconomy.give permission is op by default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAdds ChangesAdmin credit command
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Sender
participant CommandManager
participant OfflineModifier
participant OnlineRecipient
Sender->>CommandManager: Run /deco give with player, amount, and optional account
CommandManager->>OfflineModifier: Apply credit to target UUID and account
OfflineModifier-->>CommandManager: Return payment result
CommandManager-->>Sender: Send success or failure message
CommandManager-->>OnlineRecipient: Send received message when target is online
Merge Risk: ⚪ Minimal · up to The credit command’s inspected online and failure paths do not show a balance or reporting defect. It is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to The command validates players and amounts, but its console-style authorization also accepts other non-player senders. An online credit is reported as successful before it is saved, which matters for refunds and recovery after a crash. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 7.69% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 3 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks the bank and pouch, Comment |
Summary
Adds a console/operator command to credit denars to a player:
OfflineModifier, the same path BarterShops and vehicle upkeep already use. An online player is credited in their live session. An offline player is credited in their savedPlayerData/<uuid>.json, and a failed save leaves the balance unchanged.OfflineModifier.playerId(online players, Bukkit's cache,usercache.jsonand remembered names). An unknown name is refused rather than creating a new account.CONSOLE gave 12.50 to Alex (<uuid>) bank. An online recipient is told they received it.denareconomy.give, op by default. Console always passes, as withreload.giveto anyone allowed to use it, then<player>,<amount>andbank|pouch.messages.yml. Servers with an oldermessages.ymlstill get them through the existing fallback to bundled defaults.Why
The live
drops.ymlusedcarrot,potatoandbeetrootinstead of the block namescarrots,potatoesandbeetroots, so those crops never dropped coins. About 144 players are owed a refund. Until now there was no way to credit an account without hand-editing the JSON files, and that edit is lost if the player is online.Tests
mvn clean verify: 213 tests pass, and JaCoCo's 100% line, branch and instruction check still passes.CommandManagerTestcovers permissions, usage, amount and account validation, unknown players, both accounts, online notification, refused and failed payments, and tab completion.GiveCommandOfflineTestruns the command against a real saved account with no server or session and checks that the file on disk changes.🤖 Generated with Claude Code
Summary by CodeRabbit
/deco give <player> <amount> [bank|pouch]to credit a player’s bank or pouch, including when they are offline. The bank is used by default.