Paradaux
2

/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 notesPayCommand 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 contextPayCommand (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 PayTarget arg type + PayTargetResolver (in commands/resolvers/), bound into the ParameterResolver<?> multibinder in CommanderModule (which was previously empty).
  • suggestions() returns online player names + non-archived government account display names — the two things /pay resolves. 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), so PayCommand keeps 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's OfflinePlayerResolver isn't.
  • Possible refinement: listGovernmentAccounts() includes primitive/internal accounts (Eco, starting-balances, DCGovernment, GovernmentFines); they're valid /pay targets so I left them in suggestions. Can filter them out via TreasuryConstants if undesirable.

Activity

  • paradaux changed status to Status → DoneJun 7, 2026, 5:19 PM
  • paradaux description: Description updatedJun 7, 2026, 5:19 PM
  • tesks changed status to Status → Pending ReleaseJun 4, 2026, 6:43 PM
  • tesks commentedJun 4, 2026, 6:43 PM
  • tesks description: Description updatedJun 4, 2026, 9:59 AM
  • tesks commentedJun 4, 2026, 9:23 AM
  • tesks assigned Assigned to rianJun 4, 2026, 9:22 AM