Context
us.eunoians.mcrpg.listener.ability.OnComboCompleteListener#onComboComplete is a ~90-line @EventHandler that inlines every precondition check, feedback message, sound cue, and ability dispatch into a single method. A TODO(backlog) immediately above the method references this ticket.
Problems
Structural:
- One method does ability resolution, world-enablement gating, cooldown checking, mana checking, feedback messaging, ability dispatch, and cooldown application.
- Hard to add a new precondition (e.g., stamina, debuff gating) without making the method longer.
- Hard to test — each branch requires a full Bukkit event setup.
Hard-coded values:
- Feedback strings:
"On Cooldown (Ns)", "Not Enough Mana", "X is on cooldown!", "Not enough mana to use X!".
- Sounds:
Sound.UI_BUTTON_CLICK (no ability at slot), Sound.BLOCK_NOTE_BLOCK_BASS (cooldown / insufficient mana) with hard-coded pitch/volume.
CENTER_CONTENT_DURATION_TICKS = 60L — how long the action-bar feedback persists.
- All strings bypass the localization system entirely.
Proposed work
Structural:
- Split the handler into per-precondition private helpers (or a small
ComboActivationDispatcher collaborator) that each return a result type indicating success, skip, or failure-with-feedback.
- Leave the
@EventHandler method short — resolve the ability and delegate.
Configuration:
- Move feedback sounds, volumes, pitches, and the center-content persistence duration into
combo.yml with Route constants on ComboConfigFile.
- Route all player-facing strings (action bar + chat) through
McRPGLocalizationManager with new LocalizationKey routes and entries in every bundled locale YAML (English minimum).
Acceptance criteria
Context
us.eunoians.mcrpg.listener.ability.OnComboCompleteListener#onComboCompleteis a ~90-line@EventHandlerthat inlines every precondition check, feedback message, sound cue, and ability dispatch into a single method. ATODO(backlog)immediately above the method references this ticket.Problems
Structural:
Hard-coded values:
"On Cooldown (Ns)","Not Enough Mana","X is on cooldown!","Not enough mana to use X!".Sound.UI_BUTTON_CLICK(no ability at slot),Sound.BLOCK_NOTE_BLOCK_BASS(cooldown / insufficient mana) with hard-coded pitch/volume.CENTER_CONTENT_DURATION_TICKS = 60L— how long the action-bar feedback persists.Proposed work
Structural:
ComboActivationDispatchercollaborator) that each return a result type indicating success, skip, or failure-with-feedback.@EventHandlermethod short — resolve the ability and delegate.Configuration:
combo.ymlwithRouteconstants onComboConfigFile.McRPGLocalizationManagerwith newLocalizationKeyroutes and entries in every bundled locale YAML (English minimum).Acceptance criteria
onComboCompleteis at most ~20 lines; preconditions are extracted into named helpers or a collaborator.LocalizationKey+McRPGLocalizationManager.combo.yml.TODO(backlog)above the method is removed.