PAR-9
/pay does not autocomplete for players anymore
/pay <target> <amount> no longer tab-completes — it just shows the literal <target> placeholder. It should at least suggest online players (and ideally government account names) for <target>.
Technical notes — PayCommand declares <target> as a plain String, so Hibernia's CommandManager.createArgumentSuggestionProvider has no ParameterResolver to query and echoes the placeholder. Add a ParameterResolver (or a dedicated target type) whose suggestions(prefix, sender) returns online player names (+ government account display names if /pay resolves those), bound in CommanderModule. The framework already supports completions; only the resolver is missing.
Comments
tesks · Jun 4, 2026, 9:23 AM
Code context — PayCommand (treasury/…/commands/PayCommand.java) declares <target> as a plain String, so Hibernia's CommandManager.createArgumentSuggestionProvider has no ParameterResolver to query and just echoes the literal <target> placeholder — hence no completions.
Fix: add a ParameterResolver (or a dedicated target type) whose suggestions(prefix, sender) returns online player names (and government account display names if /pay should resolve those), then bind it in CommanderModule. The framework already supports completions; only the resolver is missing.
tesks · Jun 4, 2026, 6:43 PM
Fixed on develop (treasury @ dfea25e).
Root cause (confirmed): PayCommand declared <target> as a plain String, so CommandManager.createArgumentSuggestionProvider found only the no-op StringResolver and emitted the literal <target> placeholder. (The framework already ships an OfflinePlayerResolver with online-player suggestions, but it's keyed by parameter type, and /pay wasn't using that type.)
Change:
- New
PayTargetarg type +PayTargetResolver(incommands/resolvers/), bound into theParameterResolver<?>multibinder inCommanderModule(which was previously empty). suggestions()returns online player names + non-archived government account display names — the two things/payresolves. Gov names are cached with a 60s TTL because suggestions run inline on the suggestion thread per keystroke and shouldn't hit the DB.resolve()always returns the token (never empty), soPayCommandkeeps its player/government/unknown branching and i18n messages — no behavior change to dispatch.
Notes:
- Compiles; unit suite green under JDK 21. The new files sit in the coverage-excluded glue layer (
commands/**,guice/**), matching how the framework's own resolvers and Treasury's commands are treated — no in-scope code changed, so the 95% gate is unaffected. Not unit-tested for the same Bukkit-static reason the framework'sOfflinePlayerResolverisn't. - Possible refinement:
listGovernmentAccounts()includes primitive/internal accounts (Eco,starting-balances,DCGovernment,GovernmentFines); they're valid/paytargets so I left them in suggestions. Can filter them out viaTreasuryConstantsif undesirable.
Activity
- paradaux changed status to Status → Done
- paradaux description: Description updated
- tesks changed status to Status → Pending Release
- tesks commented
- tesks description: Description updated
- tesks commented
- tesks assigned Assigned to rian