Skip to content

Conversation

@itsme-to
Copy link
Contributor

@itsme-to itsme-to commented Jul 9, 2025

Information

This PR fixes #nnnn.

Details

Proposed fix:

Allows creating a clickable confirmation button for the clear command message.
The space prevents the command from being executed properly, as this tries to run '/clear ' instead of '/clear'.

Environments tested:

OS: Linux

Java version: 21

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

Demonstration:

@JRoy JRoy requested a review from Copilot July 9, 2025 18:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the formatCommand method within the Commandclearinventory class to handle empty argument arrays correctly. The issue was causing clickable confirmation buttons to generate malformed commands with trailing spaces.

  • Adds conditional logic to avoid adding unnecessary spaces when no arguments are present
  • Ensures proper command formatting for both empty and non-empty argument scenarios

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

@JRoy JRoy enabled auto-merge July 9, 2025 18:10
@JRoy JRoy disabled auto-merge July 9, 2025 18:10
@JRoy JRoy enabled auto-merge July 9, 2025 18:10
@JRoy JRoy added this pull request to the merge queue Jul 9, 2025
Merged via the queue into EssentialsX:2.x with commit b996a9f Jul 9, 2025
1 check passed
Euphillya added a commit to Euphillya/Essentials-Folia that referenced this pull request Jul 13, 2025
EssentialsX@b996a9f Fix formatCommand to handle empty args correctly (EssentialsX#6213)
EssentialsX@e39b614 Fix numerous antibuild bypasses with signs (EssentialsX#6186)
EssentialsX@cc25a79 Fix player commands option not working (EssentialsX#6214)
EssentialsX@dfd83cf Fix /tpr on legacy versions (EssentialsX#6212)
EssentialsX@e04f488 Fix inventory behavior with new body/saddle slot (EssentialsX#6218)
EssentialsX@73da278 New Crowdin updates (EssentialsX#6143)
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.

2 participants