Skip to content

Prevent invalid command casing from starting cooldowns - #6597

Open
Guflly wants to merge 1 commit into
EssentialsX:2.xfrom
Guflly:fix-command-cooldown-invalid-case
Open

Prevent invalid command casing from starting cooldowns#6597
Guflly wants to merge 1 commit into
EssentialsX:2.xfrom
Guflly:fix-command-cooldown-invalid-case

Conversation

@Guflly

@Guflly Guflly commented Jul 27, 2026

Copy link
Copy Markdown

Information

This PR fixes #5915.

Details

Proposed fix:

Preserve the command label as entered and verify that it is registered before expanding formatted aliases or applying command cooldowns. Valid lowercase aliases continue to resolve to their canonical command for cooldown matching, while invalid case variants no longer start a cooldown. The existing case-insensitive behavior is retained for pre-flattening server versions.

Environments tested:

OS: Windows 11

Java version: 21.0.10

  • Most recent Paper version (XX.YY.Z, git-Paper-BUILD)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Added regression tests confirming that /EFEED does not start a cooldown when that case variant is not registered and /efeed still applies the canonical feed cooldown.

Validation:

  • .\gradlew.bat :EssentialsX:test --tests com.earth2me.essentials.EssentialsPlayerListenerTest --console=plain
  • .\gradlew.bat :EssentialsX:checkstyleMain :EssentialsX:checkstyleTest --console=plain

Both commands completed successfully. The focused suite passed 2 tests with no failures, errors, or skipped tests.

@Guflly
Guflly marked this pull request as ready for review July 27, 2026 19:14
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.

command cooldown bug

1 participant