-
-
Notifications
You must be signed in to change notification settings - Fork 21
GH-1218 Add error message for incorrect stack number and update validation logic #1218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-1218 Add error message for incorrect stack number and update validation logic #1218
Conversation
new.messages.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request improves the validation logic and error messages for the stack amount argument in commands. The changes are solid, particularly the improved validation to reject non-positive stack amounts and the more specific error message for invalid number formats. I've identified a couple of minor issues: an outdated command usage description and inconsistent visibility for newly added configuration fields. Addressing these will improve documentation accuracy and code consistency.
eternalcore-core/src/main/java/com/eternalcode/core/feature/item/ItemCommand.java
Show resolved
Hide resolved
...ore/src/main/java/com/eternalcode/core/litecommand/argument/messages/PLArgumentMessages.java
Outdated
Show resolved
Hide resolved
| public Notice onlyPlayer = Notice.chat("<red>✘ <dark_red>Command is only for players!"); | ||
| public Notice numberBiggerThanZero = Notice.chat("<red>✘ <dark_red>The number must be greater than 0!"); | ||
| public Notice numberBiggerThanOrEqualZero = Notice.chat("<red>✘ <dark_red>The number must be greater than or equal to 0!"); | ||
| Notice stackNumberIncorrect = Notice.chat("<red>✘ <dark_red><bold>Incorrect number!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why <bold>?
| public Notice onlyPlayer = Notice.chat("<red>✘ <dark_red>Ta komenda jest dostępna tylko dla graczy!"); | ||
| public Notice numberBiggerThanZero = Notice.chat("<red>✘ <dark_red>Liczba musi być większa od 0!"); | ||
| public Notice numberBiggerThanOrEqualZero = Notice.chat("<red>✘ <dark_red>Liczba musi być równa lub większa od 0!"); | ||
| Notice stackNumberIncorrect = Notice.chat("<red>✘ <dark_red><bold>Niepoprawna liczba!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why <bold>?
# Conflicts: # eternalcore-core/src/main/java/com/eternalcode/core/litecommand/argument/messages/ENArgumentMessages.java # eternalcore-core/src/main/java/com/eternalcode/core/litecommand/argument/messages/PLArgumentMessages.java
Fixes some suggestion from LiteCommands in StackAmountArgument found during tests of GH-1214. Additionally better messages for error validation.