Fix formatCommand to handle empty args correctly#6213
Merged
JRoy merged 2 commits intoEssentialsX:2.xfrom Jul 9, 2025
itsme-to:2.x
Merged
Fix formatCommand to handle empty args correctly#6213JRoy merged 2 commits intoEssentialsX:2.xfrom itsme-to:2.x
JRoy merged 2 commits intoEssentialsX:2.xfrom
itsme-to:2.x
Conversation
Contributor
There was a problem hiding this comment.
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>
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Demonstration: