-
-
Notifications
You must be signed in to change notification settings - Fork 981
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
Get exact char instead of last for /pay modifier; Added pay-modifier-enabled config line #5496
Conversation
…enabled config line
Upstream
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.
Fundamentally this doesn't change anything, the same manipulation can be done with the first character as the last character. A proper fix is checking for exactly the modifier, and if anything else is entered reject the input.
Also worth considering if pay modifiers should even be enabled by default. |
I agree with only looking for the exact char. Would it be better to just ignore the modifier if it is not exact?
I'll have it default false |
pay-modifier-enabled is default false
I think it's safer to throw an exception there, and not assume the modifier (or no modifier) that the user intended to send if it's invalid. This shouldn't happen often, and showing an error will allow the user to make corrections and send the correct amount. |
This comment was marked as spam.
This comment was marked as spam.
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.
Couple minor things, overall looks fine to me
Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java
Show resolved
Hide resolved
Essentials/src/main/java/com/earth2me/essentials/commands/Commandpay.java
Outdated
Show resolved
Hide resolved
Essentials/src/main/java/com/earth2me/essentials/commands/InvalidModifierException.java
Outdated
Show resolved
Hide resolved
Resolved Issues |
Co-authored-by: Lax <[email protected]>
Information
This PR closes #5495
Details
Proposed feature:
This feature allows the ability to enable/disable usage of /pay modifiers such as
1k
,1m
,1b
,1t
Along with that when the command is checking for those modifiers, it checks the first char after the number instead of the last.
Environments tested:
OS: Linux
Java version: 17
Demonstration: