-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add PreTransactionEvent #6370
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
base: 2.x
Are you sure you want to change the base?
Add PreTransactionEvent #6370
Conversation
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.
what if instead PreTransactionEvent extended TransactionEvent and also allowed you to update the amount?
|
Sorry for the delay, I've made the requested change. |
| if (preTransactionEvent.isCancelled()) { | ||
| return; | ||
| } | ||
|
|
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.
should reassign value to getAmount from PreTransactionEvent
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.
I've done this now. Do you think it should also repeat the check for canAfford?
Information
I added a PreTransactionEvent for cancelling transactions between users.
Details
Proposed feature:
Adding a PreTransactionEvent.
Environments tested:
OS: Linux Mint
Java version: 23
Demonstration:
This code prevents transactions between two users when two factions can't interact.