Skip to content
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

Added Cancellable interface to event classes using CancellableTrait #99

Merged
merged 1 commit into from
May 29, 2022

Conversation

ColinHDev
Copy link
Contributor

Currently, this plugin only uses PocketMine-MP's CancellableTrait to add methods like cancel() to its event classes to make them cancellable.
But unlike the event classes of PocketMine-MP, it does not implement the Cancellable interface.

This is problematic because without this interface implemented, PMMP's internal event handlers won't know that those events are cancellable, which can be seen here.

Because of that, it is for example not possible to use PMMP's handleCancelled tag on handler methods to disable the calling of your listener if the event was already cancelled. This tag can only be used, if the event class you want to listen for, implements the Cancellable interface, which can be seen here.

@tedo0627
Copy link
Owner

I did not realize that I had to implement Cancellable interface. Thanks.

@tedo0627 tedo0627 merged commit 3569462 into tedo0627:master May 29, 2022
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